File tree Expand file tree Collapse file tree
galleries/examples/subplots_axes_and_figures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 141141# %%
142142# For subplots that are sharing axes one set of tick labels is enough. Tick
143143# labels of inner Axes are automatically removed by *sharex* and *sharey*.
144- # Still there remains an unused empty space between the subplots.
145- #
144+ # You can selectively restore them using `~.axes.Axes.tick_params`.
145+
146+ fig , axs = plt .subplots (3 , sharex = True , sharey = True )
147+ fig .suptitle ('Restored xtick labels on to Axes' )
148+ axs [0 ].plot (x , y ** 2 )
149+ axs [1 ].plot (x , 0.3 * y , 'o' )
150+ axs [2 ].plot (x , y , '+' )
151+
152+ axs [0 ].tick_params (labelbottom = True )
153+
154+ # %%
155+ # It is also possible to remove the empty space between the subplots.
146156# To precisely control the positioning of the subplots, one can explicitly
147157# create a `.GridSpec` with `.Figure.add_gridspec`, and then call its
148158# `~.GridSpecBase.subplots` method. For example, we can reduce the height
You can’t perform that action at this time.
0 commit comments