Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91b1ae8

Browse files
committed
Remove "How-to: Move the edge of an axes to make room for tick labels"
Manual adjusting the subplot parameters should be the exception nowadays. We don't need to discuss this in the FAQ. Users should primarily use tight_layout or constrained_layout, which is covered in the following section.
1 parent 9351d73 commit 91b1ae8

File tree

3 files changed

+7
-58
lines changed

3 files changed

+7
-58
lines changed

doc/faq/howto_faq.rst

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -137,57 +137,6 @@ The same can be done using the pgf backend::
137137

138138
from matplotlib.backends.backend_pgf import PdfPages
139139

140-
.. _howto-subplots-adjust:
141-
142-
Move the edge of an axes to make room for tick labels
143-
-----------------------------------------------------
144-
145-
For subplots, you can control the default spacing on the left, right,
146-
bottom, and top as well as the horizontal and vertical spacing between
147-
multiple rows and columns using the
148-
:meth:`matplotlib.figure.Figure.subplots_adjust` method (in pyplot it
149-
is :func:`~matplotlib.pyplot.subplots_adjust`). For example, to move
150-
the bottom of the subplots up to make room for some rotated x tick
151-
labels::
152-
153-
fig = plt.figure()
154-
fig.subplots_adjust(bottom=0.2)
155-
ax = fig.add_subplot(111)
156-
157-
You can control the defaults for these parameters in your
158-
:file:`matplotlibrc` file; see :doc:`/tutorials/introductory/customizing`. For
159-
example, to make the above setting permanent, you would set::
160-
161-
figure.subplot.bottom : 0.2 # the bottom of the subplots of the figure
162-
163-
The other parameters you can configure are, with their defaults
164-
165-
*left* = 0.125
166-
the left side of the subplots of the figure
167-
*right* = 0.9
168-
the right side of the subplots of the figure
169-
*bottom* = 0.1
170-
the bottom of the subplots of the figure
171-
*top* = 0.9
172-
the top of the subplots of the figure
173-
*wspace* = 0.2
174-
the amount of width reserved for space between subplots,
175-
expressed as a fraction of the average axis width
176-
*hspace* = 0.2
177-
the amount of height reserved for space between subplots,
178-
expressed as a fraction of the average axis height
179-
180-
If you want additional control, you can create an
181-
:class:`~matplotlib.axes.Axes` using the
182-
:func:`~matplotlib.pyplot.axes` command (or equivalently the figure
183-
:meth:`~matplotlib.figure.Figure.add_axes` method), which allows you to
184-
specify the location explicitly::
185-
186-
ax = fig.add_axes([left, bottom, width, height])
187-
188-
where all values are in fractional (0 to 1) coordinates. See
189-
:doc:`/gallery/subplots_axes_and_figures/axes_demo` for an example of
190-
placing axes manually.
191140

192141
.. _howto-auto-adjust:
193142

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def example_plot(ax, fontsize=12, hide_labels=False):
7777

7878
###############################################################################
7979
# To prevent this, the location of axes needs to be adjusted. For
80-
# subplots, this can be done by adjusting the subplot params
81-
# (:ref:`howto-subplots-adjust`). However, specifying your figure with the
82-
# ``constrained_layout=True`` keyword argument will do the adjusting
83-
# automatically.
80+
# subplots, this can be done manually by adjusting the subplot parameters
81+
# using `.Figure.subplots_adjust`. However, specifying your figure with the
82+
# # ``constrained_layout=True`` keyword argument will do the adjusting
83+
# # automatically.
8484

8585
fig, ax = plt.subplots(constrained_layout=True)
8686
example_plot(ax, fontsize=24)

tutorials/intermediate/tight_layout_guide.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def example_plot(ax, fontsize=12):
4646

4747
###############################################################################
4848
# To prevent this, the location of axes needs to be adjusted. For
49-
# subplots, this can be done by adjusting the subplot params
50-
# (:ref:`howto-subplots-adjust`). Matplotlib v1.1 introduced
51-
# `.Figure.tight_layout` that does this automatically for you.
49+
# subplots, this can be done manually by adjusting the subplot parameters
50+
# using `.Figure.subplots_adjust`. `.Figure.tight_layout` does this
51+
# automatically.
5252

5353
fig, ax = plt.subplots()
5454
example_plot(ax, fontsize=24)

0 commit comments

Comments
 (0)