Skip to content

Commit 984f5d6

Browse files
authored
Merge pull request #16806 from meeseeksmachine/auto-backport-of-pr-16803-on-v3.2.0-doc
Backport PR #16803 on branch v3.2.0-doc (Fix some doc issues)
2 parents f8ad3a5 + 03e6854 commit 984f5d6

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

examples/scales/log_bar.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
y = [d[i] for d in data]
2121
b = ax.bar(x + i * dimw, y, dimw, bottom=0.001)
2222

23-
ax.set_xticks(x + dimw / 2, map(str, x))
23+
ax.set_xticks(x + dimw / 2)
24+
ax.set_xticklabels(map(str, x))
2425
ax.set_yscale('log')
2526

2627
ax.set_xlabel('x')

examples/text_labels_and_annotations/text_rotation.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,20 @@ def addtext(ax, props):
3030
for x in range(0, 5):
3131
ax.scatter(x + 0.5, 0.5, color='r', alpha=0.5)
3232
ax.set_yticks([0, .5, 1])
33+
ax.set_xticks(np.arange(0, 5.1, 0.5))
3334
ax.set_xlim(0, 5)
3435
ax.grid(True)
3536

3637

3738
# the text bounding box
3839
bbox = {'fc': '0.8', 'pad': 0}
3940

40-
fig, axs = plt.subplots(2, 1)
41+
fig, axs = plt.subplots(2, 1, sharex=True)
4142

4243
addtext(axs[0], {'ha': 'center', 'va': 'center', 'bbox': bbox})
43-
axs[0].set_xticks(np.arange(0, 5.1, 0.5), [])
4444
axs[0].set_ylabel('center / center')
4545

4646
addtext(axs[1], {'ha': 'left', 'va': 'bottom', 'bbox': bbox})
47-
axs[1].set_xticks(np.arange(0, 5.1, 0.5))
4847
axs[1].set_ylabel('left / bottom')
4948

5049
plt.show()

tutorials/colors/colormaps.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
225225
plt.show()
226226

227227
###############################################################################
228-
# Lightness of matplotlib colormaps
228+
# Lightness of Matplotlib colormaps
229229
# =================================
230230
#
231231
# Here we examine the lightness values of the matplotlib colormaps.
@@ -308,10 +308,9 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
308308
formatter = mpl.ticker.FixedFormatter(cmap_list[i*dsub:(i+1)*dsub])
309309
ax.xaxis.set_major_formatter(formatter)
310310
ax.xaxis.set_tick_params(rotation=50)
311+
ax.set_ylabel('Lightness $L^*$', fontsize=12)
311312

312313
ax.set_xlabel(cmap_category + ' colormaps', fontsize=14)
313-
fig.text(0.0, 0.55, 'Lightness $L^*$', fontsize=12,
314-
transform=fig.transFigure, rotation=90)
315314

316315
fig.tight_layout(h_pad=0.0, pad=1.5)
317316
plt.show()

0 commit comments

Comments
 (0)