Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6925bf6

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

File tree

Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed

‎examples/scales/log_bar.py

Copy file name to clipboardExpand all lines: examples/scales/log_bar.py
+2-1Lines 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

Copy file name to clipboardExpand all lines: examples/text_labels_and_annotations/text_rotation.py
+2-3Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.