Skip to content

Commit 914f533

Browse files
authored
Merge pull request #25388 from oscargus/al
Better axis labels for examples
2 parents 7c07acf + e20ed5b commit 914f533

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=======================
3-
Simple Axis Direction01
4-
=======================
2+
=====================
3+
Simple axis direction
4+
=====================
55
66
"""
77
import matplotlib.pyplot as plt
@@ -13,10 +13,10 @@
1313
fig.subplots_adjust(right=0.8)
1414

1515
ax1.axis["left"].major_ticklabels.set_axis_direction("top")
16-
ax1.axis["left"].label.set_text("Label")
16+
ax1.axis["left"].label.set_text("Left label")
1717

1818
ax1.axis["right"].label.set_visible(True)
19-
ax1.axis["right"].label.set_text("Label")
19+
ax1.axis["right"].label.set_text("Right label")
2020
ax1.axis["right"].label.set_axis_direction("left")
2121

2222
plt.show()

galleries/examples/axisartist/simple_axis_direction03.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""
2-
=======================
3-
Simple Axis Direction03
4-
=======================
2+
==========================================
3+
Simple axis tick label and tick directions
4+
==========================================
55
6+
First subplot moves the tick labels to inside the spines.
7+
Second subplots moves the ticks to inside the spines.
8+
These effects can be obtained for a standard Axes by `~.Axes.tick_params`.
69
"""
710

811
import matplotlib.pyplot as plt
@@ -21,15 +24,15 @@ def setup_axes(fig, pos):
2124
fig.subplots_adjust(wspace=0.4, bottom=0.3)
2225

2326
ax1 = setup_axes(fig, 121)
24-
ax1.set_xlabel("X-label")
25-
ax1.set_ylabel("Y-label")
27+
ax1.set_xlabel("ax1 X-label")
28+
ax1.set_ylabel("ax1 Y-label")
2629

2730
ax1.axis[:].invert_ticklabel_direction()
2831

2932
ax2 = setup_axes(fig, 122)
30-
ax2.set_xlabel("X-label")
31-
ax2.set_ylabel("Y-label")
33+
ax2.set_xlabel("ax2 X-label")
34+
ax2.set_ylabel("ax2 Y-label")
3235

33-
ax2.axis[:].major_ticks.set_tick_out(True)
36+
ax2.axis[:].major_ticks.set_tick_out(False)
3437

3538
plt.show()

0 commit comments

Comments
 (0)