10000 DOC: Fix calls to Axes.set_xticks with minor ticks. · matplotlib/matplotlib@6925bf6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6925bf6

Browse files
committed
DOC: Fix calls to Axes.set_xticks with minor ticks.
These were incorrect conversions of `plt.xticks`.
1 parent 6bba974 commit 6925bf6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/scales/log_bar.py

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 3 deletions
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()

0 commit comments

Comments
 (0)
0