Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Figure background colors #7619

Copy link
Copy link
Closed
Closed
Copy link
@darkdragon-001

Description

@darkdragon-001
Issue body actions

I find the current handling of background colors very non-intuitive:

  1. figure facecolor is not applied for savefig() by default
  2. figure facecolor is not applied setting frameon=False
  3. axis_bgcolor is not applied when hiding axis lines/ticks via axis('off')

So using a white plain surface to draw objects needs the following code:

fig = figure(..., facecolor='w', edgecolor='None')
ax.axis('equal')        # equal scale
ax.axis('off')          # do not show axis
ax.axis([-1, 1, -1, 1]) # scale to unit lengths
show()
fig.savefig(..., facecolor=fig.get_facecolor(), edgecolor='None', transparent=True)

My suggestion

  • apply same colors to savefig() by default
  • mention in the docs of axis_bgcolor and axis('off') that this setting is ignored
  • mention in the docs of facecolor and frameon that this setting is ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.