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

Second attempt at fixing axis inversion (for mpl3.1).#14643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ivanov merged 1 commit intomatplotlib:v3.1.xfromanntzer:moreaxisinversion
Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletionslib/matplotlib/axes/_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3264,11 +3264,10 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
cbook._warn_external(
f"Attempting to set identical left == right == {left} results "
f"in singular transformations; automatically expanding.")
swapped = left > right
reverse = left > right
left, right = self.xaxis.get_major_locator().nonsingular(left, right)
left, right = self.xaxis.limit_range_for_scale(left, right)
if swapped:
left, right = right, left
left, right = sorted([left, right], reverse=reverse)

self.viewLim.intervalx = (left, right)
if auto is not None:
Expand DownExpand Up@@ -3647,11 +3646,10 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
f"Attempting to set identical bottom == top == {bottom} "
f"results in singular transformations; automatically "
f"expanding.")
swapped = bottom > top
reverse = bottom > top
bottom, top = self.yaxis.get_major_locator().nonsingular(bottom, top)
bottom, top = self.yaxis.limit_range_for_scale(bottom, top)
if swapped:
bottom, top = top, bottom
bottom, top = sorted([bottom, top], reverse=reverse)

self.viewLim.intervaly = (bottom, top)
if auto is not None:
Expand Down
5 changes: 2 additions & 3 deletionslib/mpl_toolkits/mplot3d/axes3d.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -623,11 +623,10 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False,
cbook._warn_external(
f"Attempting to set identical left == right == {left} results "
f"in singular transformations; automatically expanding.")
swapped = left > right
reverse = left > right
left, right = self.xaxis.get_major_locator().nonsingular(left, right)
left, right = self.xaxis.limit_range_for_scale(left, right)
if swapped:
left, right = right, left
left, right = sorted([left, right], reverse=reverse)
self.xy_viewLim.intervalx = (left, right)

if auto is not None:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp