-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Ability to scale axis by a fixed factor #10321
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
df16efc
Fixed scaling when lower power limit = upper <> 0
HHest 45e1bf3
Update doc with fixed scaling feature
HHest d001033
Fix line length and PEP spacing complaints
HHest b12202a
move fixed-scaling check higher up
HHest 130f257
whats new for fixed-scaling of axis
HHest 482e07a
Test for several ScalarFormatter methods
HHest 38af9db
Fix PEP8 errors
HHest c23ef3b
Take scilimits = single integer for fixed-scaling
HHest d2a1769
Update for scilimits=single int
HHest 01fb668
removed trailing space for pep8
HHest 3260e70
Revert the scilimits = single int change
HHest 2188177
Revert scilimits = single int change
HHest 50a9695
Add explanation linking to previous behavior.
HHest 5465a81
Fix reference to y axis
HHest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
doc/users/next_whats_new/2018_01_25_scale_axis_by_factor.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Ability to scale axis by a fixed order of magnitude | ||
--------------------------------------------------- | ||
|
||
To scale an axis by a fixed order of magnitude, set the *scilimits* argument of | ||
``Axes.ticklabel_format`` to the same (non-zero) lower and upper limits. Say to scale | ||
the y axis by a million (1e6), use ``ax.ticklabel_format(style='sci', scilimits=(6, 6), axis='y')``. | ||
|
||
The behavior of ``scilimits=(0, 0)`` is unchanged. With this setting, matplotlib will adjust | ||
the order of magnitude depending on the axis values, rather than keeping it fixed. Previously, setting | ||
``scilimits=(m, m)`` was equivalent to setting ``scilimits=(0, 0)``. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a scalar example into here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we've decided not to take in scalar anymore, this is a moot point..., but just for posterity sake, my intention was to allow scalar input at the ticklabel_format API level, not at this lower level, where the test sits. The scalar input would then be translated to pair of (repeated) values for lower level consumption.