File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 11"""
2- =======================
3- Simple Axis Direction01
4- =======================
2+ =====================
3+ Simple axis direction
4+ =====================
55
66"""
77import matplotlib .pyplot as plt
1212fig .subplots_adjust (right = 0.8 )
1313
1414ax1 .axis ["left" ].major_ticklabels .set_axis_direction ("top" )
15- ax1 .axis ["left" ].label .set_text ("Label " )
15+ ax1 .axis ["left" ].label .set_text ("Left label " )
1616
1717ax1 .axis ["right" ].label .set_visible (True )
18- ax1 .axis ["right" ].label .set_text ("Label " )
18+ ax1 .axis ["right" ].label .set_text ("Right label " )
1919ax1 .axis ["right" ].label .set_axis_direction ("left" )
2020
2121plt .show ()
Original file line number Diff line number Diff line change 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
811import matplotlib .pyplot as plt
@@ -20,15 +23,15 @@ def setup_axes(fig, pos):
2023fig .subplots_adjust (wspace = 0.4 , bottom = 0.3 )
2124
2225ax1 = setup_axes (fig , 121 )
23- ax1 .set_xlabel ("X-label" )
24- ax1 .set_ylabel ("Y-label" )
26+ ax1 .set_xlabel ("ax1 X-label" )
27+ ax1 .set_ylabel ("ax1 Y-label" )
2528
2629ax1 .axis [:].invert_ticklabel_direction ()
2730
2831ax2 = setup_axes (fig , 122 )
29- ax2 .set_xlabel ("X-label" )
30- ax2 .set_ylabel ("Y-label" )
32+ ax2 .set_xlabel ("ax2 X-label" )
33+ ax2 .set_ylabel ("ax2 Y-label" )
3134
32- ax2 .axis [:].major_ticks .set_tick_out (True )
35+ ax2 .axis [:].major_ticks .set_tick_out (False )
3336
3437plt .show ()
You can’t perform that action at this time.
0 commit comments