-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Removes OldScalarFormatter #7956 #8295
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
NelleV
merged 6 commits into
matplotlib:master
from
NinadBhat:Suggested-improvements-to-the-gallery
Mar 17, 2017
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
27de919
Removes OldScalarFormatter
NinadBhat 71a4eb8
Renaming file to scalarformatter_demo.py
NinadBhat a8af90e
Renaming to plot_scalarformatter.py
NinadBhat a218217
Adds title and description
NinadBhat eab3d7f
changing name in backend_driver.py
NinadBhat 375fd31
Correcting typos and moving file to ticks and spines
NinadBhat 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from matplotlib.ticker import OldScalarFormatter, ScalarFormatter | ||
""" | ||
========================================= | ||
Tick formatting using the ScalarFromatter | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is still a typo here (that I am fine fixing just before merging). |
||
========================================= | ||
|
||
# Example 1 | ||
x = np.arange(0, 1, .01) | ||
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6)) | ||
fig.text(0.5, 0.975, 'The old formatter', | ||
horizontalalignment='center', verticalalignment='top') | ||
ax1.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5) | ||
ax1.xaxis.set_major_formatter(OldScalarFormatter()) | ||
ax1.yaxis.set_major_formatter(OldScalarFormatter()) | ||
|
||
ax2.plot(x * 1e5, x * 1e-4) | ||
ax2.xaxis.set_major_formatter(OldScalarFormatter()) | ||
ax2.yaxis.set_major_formatter(OldScalarFormatter()) | ||
The example shows use of ScalarFormatter with different settings. | ||
|
||
ax3.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10) | ||
ax3.xaxis.set_major_formatter(OldScalarFormatter()) | ||
ax3.yaxis.set_major_formatter(OldScalarFormatter()) | ||
Example 1 : Default | ||
|
||
ax4.plot(-x * 1e5, -x * 1e-4) | ||
ax4.xaxis.set_major_formatter(OldScalarFormatter()) | ||
ax4.yaxis.set_major_formatter(OldScalarFormatter()) | ||
Example 2 : With no Numerical Offset | ||
|
||
fig.subplots_adjust(wspace=0.7, hspace=0.6) | ||
Example 3 : With Mathtext | ||
""" | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from matplotlib.ticker import ScalarFormatter | ||
|
||
# Example 2 | ||
# Example 1 | ||
x = np.arange(0, 1, .01) | ||
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6)) | ||
fig.text(0.5, 0.975, 'The new formatter, default settings', | ||
|
@@ -50,7 +40,7 @@ | |
|
||
fig.subplots_adjust(wspace=0.7, hspace=0.6) | ||
|
||
# Example 3 | ||
# Example 2 | ||
x = np.arange(0, 1, .01) | ||
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6)) | ||
fig.text(0.5, 0.975, 'The new formatter, no numerical offset', | ||
|
@@ -75,7 +65,7 @@ | |
|
||
fig.subplots_adjust(wspace=0.7, hspace=0.6) | ||
|
||
# Example 4 | ||
# Example 3 | ||
x = np.arange(0, 1, .01) | ||
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6)) | ||
fig.text(0.5, 0.975, 'The new formatter, with mathtext', | ||
|
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.
@NelleV: This should go to files['ticks_and_spines'] right?
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.
If I understood properly from a conversation with @tacaswell, this file is way out of date and unmaintained.
@tacaswell can you confirm or correct this?
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.
Maybe you're thinking of #8069?
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.
No I think of a later discussion (last week or so)
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.
Once #8069 goes through all these explicit example file references will be gone anyway, so I don't think this matters.