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

Fix axis inversion with loglocator and logitlocator.#14624

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
tacaswell merged 1 commit intomatplotlib:masterfromanntzer:loglocatororder
Aug 20, 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
6 changes: 0 additions & 6 deletionsdoc/api/next_api_changes/2019-03-04-AL.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,9 +47,3 @@ properties of the `.Collection` object:
While this seems complicated, the logic is simply to use the information from
the object that are in data space for the limits, but not information that is
in physical units.

LogLocator.nonsingular now maintains the orders of its arguments
````````````````````````````````````````````````````````````````

It no longer reorders them in increasing order. The new behavior is consistent
with MaxNLocator.
7 changes: 7 additions & 0 deletionsdoc/api/next_api_changes/2019-06-25-AL.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
API changes
```````````

``Locator.nonsingular`` (introduced in mpl 3.1), ``DateLocator.nonsingular``, and
``AutoDateLocator.nonsingular`` now returns a range ``v0, v1`` with ``v0 <= v1``.
This behavior is consistent with the implementation of ``nonsingular`` by the
``LogLocator`` and ``LogitLocator`` subclasses.
5 changes: 4 additions & 1 deletionlib/matplotlib/dates.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1117,8 +1117,9 @@ def nonsingular(self, vmin, vmax):
"""
Given the proposed upper and lower extent, adjust the range
if it is too close to being singular (i.e. a range of ~0).

"""
if vmax < vmin:
vmin, vmax = vmax, vmin
unit = self._get_unit()
interval = self._get_interval()
if abs(vmax - vmin) < 1e-6:
Expand DownExpand Up@@ -1336,6 +1337,8 @@ def tick_values(self, vmin, vmax):
def nonsingular(self, vmin, vmax):
# whatever is thrown at us, we can scale the unit.
# But default nonsingular date plots at an ~4 year period.
if vmax < vmin:
vmin, vmax = vmax, vmin
if vmin == vmax:
vmin = vmin - DAYS_PER_YEAR * 2
vmax = vmax + DAYS_PER_YEAR * 2
Expand Down
4 changes: 0 additions & 4 deletionslib/matplotlib/ticker.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2495,9 +2495,7 @@ def view_limits(self, vmin, vmax):
return vmin, vmax

def nonsingular(self, vmin, vmax):
swap_vlims = False
if vmin > vmax:
swap_vlims = True
vmin, vmax = vmax, vmin
if not np.isfinite(vmin) or not np.isfinite(vmax):
vmin, vmax = 1, 10 # Initial range, no data plotted yet.
Expand All@@ -2515,8 +2513,6 @@ def nonsingular(self, vmin, vmax):
if vmin == vmax:
vmin = _decade_less(vmin, self._base)
vmax = _decade_greater(vmax, self._base)
if swap_vlims:
vmin, vmax = vmax, vmin
return vmin, vmax


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp