8000 Apply suggestions from code review · matplotlib/matplotlib@35000fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 35000fb

Browse files
jklymakQuLogic
andauthored
Apply suggestions from code review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 8b38904 commit 35000fb

File tree

Expand file tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

doc/api/next_api_changes/behavior/17494-JMK.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ User-facing changes are:
77

88
- some poorly constrained layouts will have different width/height plots than
99
before.
10-
- colorbars now respect the ``anchor`` kwarg of `colorbar.make_axes`
10+
- colorbars now respect the ``anchor`` keyword argument of `.colorbar.make_axes`
1111
- colorbars are wider.
1212
- colorbars in different rows or columns line up more robustly.
13-
- ``hspace`` and ``wspace`` options to `figure.set_constrained_layout_pads`
13+
- *hspace* and *wspace* options to `.Figure.set_constrained_layout_pads`
1414
were twice as wide as the docs said they should be. So these now follow
1515
the docs.
1616

17-
This feature will remain ``experimental'' until the new changes have been
17+
This feature will remain "experimental" until the new changes have been
1818
used enough by users, so we anticipate version 3.5 or 3.6. On the other hand,
1919
``constrained_layout`` is extensively tested and used in examples in the
20-
library, so using it should be safe, but images may not be exactly the same
20+
library, so using it should be safe, but layouts may not be exactly the same
2121
as more development takes place.
2222

2323
Details of using ``constrained_layout``, and its algorithm are available at

lib/matplotlib/gridspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def __init__(self, nrows, ncols,
595595
self._layoutgrid = None
596596
else:
597597
# this _toplayoutbox is a container that spans the cols and
598-
# rows in the parent gridspec. Not yet implimented,
598+
# rows in the parent gridspec. Not yet implemented,
599599
# but we do this so that its possible to have subgridspec
600600
# level artists.
601601
self._toplayoutgrid = layoutgrid.LayoutGrid(

lib/matplotlib/tests/test_constrainedlayout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def test_colorbars_no_overlapV():
468468
fig = plt.figure(figsize=(2, 4), constrained_layout=True)
469469
axs = fig.subplots(2, 1, sharex=True, sharey=True)
470470
for ax in axs:
471-
ax.yaxis.set_major_formatter(plt.NullFormatter())
471+
ax.yaxis.set_major_formatter(ticker.NullFormatter())
472472
ax.tick_params(axis='both', direction='in')
473473
im = ax.imshow([[1, 2], [3, 4]])
474474
fig.colorbar(im, ax=ax, orientation="vertical")
@@ -482,7 +482,7 @@ def test_colorbars_no_overlapH():
482482
fig.suptitle("foo")
483483
axs = fig.subplots(1, 2, sharex=True, sharey=True)
484484
for ax in axs:
485-
ax.yaxis.set_major_formatter(plt.NullFormatter())
485+
ax.yaxis.set_major_formatter(ticker.NullFormatter())
486486
ax.tick_params(axis='both', direction='in')
487487
im = ax.imshow([[1, 2], [3, 4]])
488488
fig.colorbar(im, ax=ax, orientation="horizontal")

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
268268
wspace=0.2)
269269

270270
##########################################
271-
# GridSpecs also have a ``hspace`` and ``wspace`` optional kwarg, that will
271+
# GridSpecs also have optional ``hspace`` and ``wspace`` keyword arguments, that will
272272
# be used instead of the pads set by ``constrained_layout``:
273273

274274
fig, axs = plt.subplots(2, 2, constrained_layout=True,
@@ -567,8 +567,8 @@ def docomplicated(suptitle=None):
567567
#
568568
# Layout in Matplotlib is carried out with gridspecs
569569
# via the `~.GridSpec` class. A gridspec is a logical division of the figure
570-
# into rows and columns, with the reltive width of the axes in those
571-
# rows and columns set by width_ratios and height ratios.
570+
# into rows and columns, with the relative width of the Axes in those
571+
# rows and columns set by *width_ratios* and *height_ratios*.
572572
#
573573
# In constrained_layout, each gridspec gets a *layoutgrid* associated with
574574
# it. The *layoutgrid* has a series of ``left`` and ``right`` variables
@@ -690,7 +690,7 @@ def docomplicated(suptitle=None):
690690
plot_children(fig, fig._layoutgrid, printit=False)
691691

692692
#######################################################################
693-
# One case that requires finessing if margins do not have any artists
693+
# One case that requires finessing is if margins do not have any artists
694694
# constraining their width. In the case below, the right margin for column 0
695695
# and the left margin for column 3 have no margin artists to set their width,
696696
# so we take the maximum width of the margin widths that have artists.

0 commit comments

Comments
 (0)
0