Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

make subplots smarter with regards to subplot_kw and figure_kw #1460

Closed
Labels
@ivanov

Description

@ivanov

While working on#1458, it occurred to me that it might not be a bad idea to process the keyword arguments given toplt.subplots and pass them along in the appropriate direction. As I alluded to in#1458, currently, to replace lines like:

fig = plt.figure(figsize=(10,20))
ax = plt.subplot(111, axisbg='w')

you have to do an awkward thing to subplot's keyword arguments, since,subplot*s* passes its keyword arguments to plt.figure.

fig, ax = plt.subplots(figsize=(10,20), subplot_kw=dict(axisbg='w'))

but, at least as I was going through our examples, all of the subplot keyword arguments were pretty unambiguously named, and could not be interpreted as figure keyword arguments. So there's no reason why we shouldn't make the next line work the same as the two examples above:

fig, ax = plt.subplots(figsize=(10,20), axisbg='w')

in our docs, plt.axes takes these kwargs:

axisbg    color          the axes background colorframeon   [True|False]   display the frame?sharex    otherax        current axes shares xaxis attribute with otheraxsharey    otherax        current axes shares yaxis attribute with otheraxpolar     [True|False]   use a polar axes?

and plt.subplot says it deals withaxisbg,polar, andprojection

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp