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

[ENH]: Improve rememberability of position rectangles wrt. start-end vs. start-delta #22515

Open
@anntzer

Description

@anntzer

Problem

It is always a bit hard for me to remember whetheradd_axes takes(left, bottom, right, top) or(left, bottom, width, height) (especially because needing to manually place axes is not so common -- but sometimes you do need it). Perhaps a solution would be to support both, or possibly some additional APIs, based on keyword (not all of them may be worth adding, I'm just trying to be exhaustive):

fig.add_axes([l,b,w,h])# current APIfig.add_axes(rect=[l,b,w,h])# current API# add some simple aliasesfig.add_axes(lbwh=[l,b,w,h])fig.add_axes(xxyy=[x0,x1,y0,y1])fig.add_axes(xyxy=[x0,y0,x1,y1])fig.add_axes(corners=[(x0,y0), (x1,y1)])# cf. discussion on grouping arguments to vector().

(Note that all these can probably be implemented "relatively" easily via setters, i.e. default of rect=None, pass the kwargs to the setters, and at the end of of__init__, check that one of the position-specifying args has been passed.)

Alternatively,add_axes also supports taking aBbox, so one can write

fig.add_axes(Bbox([(x0,y0), (x1,y1)]))# Perhaps that's the most rememberable for me...fig.add_axes(Bbox.from_extents(x0,y0,x1,y1))fig.add_axes(Bbox.from_bounds(x0,y0,w,h))

but note that the namebounds ("start-delta") is not consistent withAxes.set_xbound/Axes.set_ybound (and the more rarely usedSpine.set_bounds), which both use the "start-end" convention :(

Proposed solution

No response

Metadata

Metadata

Assignees

No one assigned

    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