-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix issues in examples, docs, and tutorials #23605
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
Changes from all commits
5d367de
374023d
94633be
f4ca036
2698de3
b60661b
1cd2998
137ebfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
'center', 'left', or 'right' can be controlled using the horizontal alignment | ||
property:: | ||
|
||
for label in ax.xaxis.get_xticklabels(): | ||
for label in ax.get_xticklabels(): | ||
label.set_horizontalalignment('right') | ||
|
||
However there is no direct way to center the labels between ticks. To fake | ||
|
@@ -23,7 +23,7 @@ | |
import matplotlib.ticker as ticker | ||
import matplotlib.pyplot as plt | ||
|
||
# load some financial data; Google's stock price | ||
# Load some financial data; Google's stock price | ||
r = (cbook.get_sample_data('goog.npz', np_load=True)['price_data'] | ||
.view(np.recarray)) | ||
r = r[-250:] # get the last 250 days | ||
|
@@ -38,11 +38,12 @@ | |
ax.xaxis.set_major_formatter(ticker.NullFormatter()) | ||
ax.xaxis.set_minor_formatter(dates.DateFormatter('%b')) | ||
|
||
for tick in ax.xaxis.get_minor_ticks(): | ||
tick.tick1line.set_markersize(0) | ||
tick.tick2line.set_markersize(0) | ||
tick.label1.set_horizontalalignment('center') | ||
# Remove the tick lines | ||
ax.tick_params(axis='x', which='minor', tick1On=False, tick2On=False) | ||
|
||
# Align the minor tick label | ||
for label in ax.get_xticklabels(minor=True): | ||
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. This is maybe not the best thing to loop over. But this is the method mentioned at the top, so from that perspective it makes more sense. |
||
label.set_horizontalalignment('center') | ||
imid = len(r) // 2 | ||
ax.set_xlabel(str(r.date[imid].item().year)) | ||
plt.show() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ def _contour_args(self, args, kwargs): | |
The colors of the levels, i.e., the contour %%(type)s. | ||
|
||
The sequence is cycled for the levels in ascending order. If the sequence | ||
is shorter than the number of levels, it's repeated. | ||
is shorter than the number of levels, it is repeated. | ||
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. Not really required. More a consequence of the other instance being incorrect. |
||
|
||
As a shortcut, single color strings may be used in place of one-element | ||
lists, i.e. ``'red'`` instead of ``['red']`` to color all levels with the | ||
|
Uh oh!
There was an error while loading. Please reload this page.