8000 DOC: Fix small issues in new release notes. · matplotlib/matplotlib@f81a08d · GitHub
[go: up one dir, main page]

Skip to content

Commit f81a08d

Browse files
QuLogictacaswell
authored andcommitted
DOC: Fix small issues in new release notes.
1 parent ce9243e commit f81a08d

File tree

5 files changed

+82
-89
lines changed

5 files changed

+82
-89
lines changed

doc/api/api_changes.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ properties.
7373

7474
The :class:`~matplotlib.legend.Legend` background patch (or 'frame')
7575
can have its `edgecolor` and `facecolor` determined by the
76-
corresponding keyword arguments to its initializer, or to any of the
76+
corresponding keyword arguments to the `Legend` initializer, or to any of the
7777
methods or functions that call that initializer. If left to
7878
their default values of `None`, their values will be taken from
7979
`rcParams`. The previously-existing `framealpha` kwarg still
@@ -108,15 +108,15 @@ See the ``draw_image`` docstring for more information.
108108
--------------------------------------------------
109109

110110
The ``matplotlib.ticker.LinearLocator`` is used to define the range and location
111-
of tickmarks of a plot when the user wants a exact number of ticks.
111+
of tick marks of a plot when the user wants an exact number of ticks.
112112
``LinearLocator`` thus differs from the default locator ``MaxNLocator``, which
113113
does not necessarily return the exact user requested number of ticks.
114114

115115
The view range algorithm in ``matplotlib.ticker.LinearLocator`` has been
116-
changed so that more convenient tick location are chosen. The new algorithm
117-
returns a plot view range that is a multiple of the user requested number of
118-
ticks. This ensures tick marks to be located at whole integers more
119-
constistently. For example, when both y-axis of a``twinx`` plot use
116+
changed so that more convenient tick locations are chosen. The new algorithm
117+
returns a plot view range that is a multiple of the user-requested number of
118+
ticks. This ensures tick marks will be located at whole integers more
119+
consistently. For example, when both y-axes of a``twinx`` plot use
120120
``matplotlib.ticker.LinearLocator`` with the same number of ticks, the grids of
121121
both axis will be properly aligned at convenient tick locations.
122122

@@ -126,7 +126,7 @@ New defaults for 3D quiver function in mpl_toolkits.mplot3d.axes3d.py
126126

127127
Matplotlib has both a 2D and a 3D ``quiver`` function. These changes
128128
affect only the 3D function and make the default behavior of the 3D
129-
function match 2D version. There are two changes:
129+
function match the 2D version. There are two changes:
130130

131131
1) The 3D quiver function previously normalized the arrows to be the
132132
same length, which makes it unusable for situations where the
@@ -143,7 +143,7 @@ call the function with ::
143143

144144
ax.quiver(x, y, z, u, v, w, normalize=True, pivot='tip')
145145

146-
where "ax" is a axes3d object created with something like ::
146+
where "ax" is an ``Axes3d`` object created with something like ::
147147

148148
import mpl_toolkits.mplot3d.axes3d
149149
ax = plt.sublot(111, projection='3d')

doc/users/annotations.rst

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ For physical coordinate systems (points or pixels) the origin is the
5555
however, the origin is from the (right, top) of the figure or axes,
5656
analogous to negative indexing of sequences.
5757

58-
Optionally, you can specify arrow properties for adding an arrow
59-
from the text to the annotated point by giving a dictionary of arrow
60-
properties in the optional keyword argument ``arrowprops``.
58+
Optionally, you can enable drawing of an arrow from the text to the annotated
59+
point by giving a dictionary of arrow properties in the optional keyword
60+
argument ``arrowprops``.
6161

6262

6363
==================== =====================================================
@@ -90,9 +90,8 @@ annotations, including fancy arrows, see :ref:`plotting-guide-annotation`
9090
and :ref:`pylab_examples-annotation_demo`.
9191

9292

93-
Do not proceed unless you already have read :ref:`annotations-tutorial`,
94-
:func:`~matplotlib.pyplot.text` and
95-
:func:`~matplotlib.pyplot.annotate`!
93+
Do not proceed unless you have already read :ref:`annotations-tutorial`,
94+
:func:`~matplotlib.pyplot.text` and :func:`~matplotlib.pyplot.annotate`!
9695

9796

9897
.. _plotting-guide-annotation:
@@ -125,7 +124,7 @@ The patch object associated with the text can be accessed by::
125124

126125
The return value is an instance of FancyBboxPatch and the patch
127126
properties like facecolor, edgewidth, etc. can be accessed and
128-
modified as usual. To change the shape of the box, use *set_boxstyle*
127+
modified as usual. To change the shape of the box, use the *set_boxstyle*
129128
method. ::
130129

131130
bb.set_boxstyle("rarrow", pad=0.6)
@@ -150,7 +149,7 @@ keyword arguments. Currently, following box styles are implemented.
150149
.. plot:: mpl_examples/pylab_examples/fancybox_demo2.py
151150

152151

153-
Note that the attributes arguments can be specified within the style
152+
Note that the attribute arguments can be specified within the style
154153
name with separating comma (this form can be used as "boxstyle" value
155154
of bbox argument when initializing the text instance) ::
156155

@@ -177,7 +176,7 @@ annotated point is specified in the *data* coordinate and the annotating
177176
text in *offset points*.
178177
See :func:`~matplotlib.pyplot.annotate` for available coordinate systems.
179178

180-
An arrow connecting two point (xy & xytext) can be optionally drawn by
179+
An arrow connecting two points (xy & xytext) can be optionally drawn by
181180
specifying the ``arrowprops`` argument. To draw only an arrow, use
182181
empty string as the first argument. ::
183182

@@ -198,7 +197,7 @@ The arrow drawing takes a few steps.
198197
2. If patch object is given (*patchA* & *patchB*), the path is clipped to
199198
avoid the patch.
200199

201-
3. The path is further shrunk by given amount of pixels (*shirnkA*
200+
3. The path is further shrunk by given amount of pixels (*shrinkA*
202201
& *shrinkB*)
203202

204203
4. The path is transmuted to arrow patch, which is controlled by the
@@ -209,7 +208,7 @@ The arrow drawing takes a few steps.
209208

210209

211210
The creation of the connecting path between two points is controlled by
212-
``connectionstyle`` key and following styles are available.
211+
``connectionstyle`` key and the following styles are available.
213212

214213
========== =============================================
215214
Name Attrs
@@ -223,7 +222,7 @@ The creation of the connecting path between two points is controlled by
223222

224223
Note that "3" in ``angle3`` and ``arc3`` is meant to indicate that the
225224
resulting path is a quadratic spline segment (three control
226-
points). As will be discussed below, some arrow style option only can
225+
points). As will be discussed below, some arrow style options can only
227226
be used when the connecting path is a quadratic spline.
228227

229228
The behavior of each connection style is (limitedly) demonstrated in the
@@ -255,9 +254,9 @@ an arrow patch, according to the given ``arrowstyle``.
255254

256255
.. plot:: mpl_examples/pylab_examples/fancyarrow_demo.py
257256

258-
Some arrowstyles only work with connection style that generates a
257+
Some arrowstyles only work with connection styles that generate a
259258
quadratic-spline segment. They are ``fancy``, ``simple``, and ``wedge``.
260-
For these arrow styles, you must use "angle3" or "arc3" connection
259+
For these arrow styles, you must use the "angle3" or "arc3" connection
261260
style.
262261

263262
If the annotation string is given, the patchA is set to the bbox patch
@@ -281,8 +280,8 @@ lower-left corner and (1,1) means top-right.
281280
Placing Artist at the anchored location of the Axes
282281
---------------------------------------------------
283282

284-
There are class of artist that can be placed at the anchored location
285-
of the Axes. A common example is the legend. This type of artists can
283+
There are classes of artists that can be placed at an anchored location
284+
in the Axes. A common example is the legend. This type of artist can
286285
be created by using the OffsetBox class. A few predefined classes are
287286
available in ``mpl_toolkits.axes_grid.anchored_artists``. ::
288287

@@ -305,10 +304,10 @@ artists) is known in pixel size during the time of creation. For
305304
example, If you want to draw a circle with fixed size of 20 pixel x 20
306305
pixel (radius = 10 pixel), you can utilize
307306
``AnchoredDrawingArea``. The instance is created with a size of the
308-
drawing area (in pixel). And user can add arbitrary artist to the
307+
drawing area (in pixels), and arbitrary artists can added to the
309308
drawing area. Note that the extents of the artists that are added to
310-
the drawing area has nothing to do with the placement of the drawing
311-
area itself. The initial size only matters. ::
309+
the drawing area are not related to the placement of the drawing
310+
area itself. Only the initial size matters. ::
312311

313312
from mpl_toolkits.axes_grid.anchored_artists import AnchoredDrawingArea
314313

@@ -319,27 +318,27 @@ area itself. The initial size only matters. ::
319318
p2 = Circle((30, 10), 5, fc="r")
320319
ada.drawing_area.add_artist(p2)
321320

322-
The artists that are added to the drawing area should not have
323-
transform set (they will be overridden) and the dimension of those
321+
The artists that are added to the drawing area should not have a
322+
transform set (it will be overridden) and the dimensions of those
324323
artists are interpreted as a pixel coordinate, i.e., the radius of the
325-
circles in above example are 10 pixel and 5 pixel, respectively.
324+
circles in above example are 10 pixels and 5 pixels, respectively.
326325

327326
.. plot:: users/plotting/examples/anchored_box02.py
328327

329-
Sometimes, you want to your artists scale with data coordinate (or
330-
other coordinate than canvas pixel). You can use
328+
Sometimes, you want your artists to scale with the data coordinate (or
329+
coordinates other than canvas pixels). You can use
331330
``AnchoredAuxTransformBox`` class. This is similar to
332331
``AnchoredDrawingArea`` except that the extent of the artist is
333332
determined during the drawing time respecting the specified transform. ::
334333

335334
from mpl_toolkits.axes_grid.anchored_artists import AnchoredAuxTransformBox
336335

337336
box = AnchoredAuxTransformBox(ax.transData, loc=2)
338-
el = Ellipse((0,0), width=0.1, height=0.4, angle=30) # in data coordinates!
337+
el = Ellipse((0,0), width=0.1, height=0.4, angle=30) # in data coordinates!
339338
box.drawing_area.add_artist(el)
340339

341340
The ellipse in the above example will have width and height
342-
corresponds to 0.1 and 0.4 in data coordinate and will be
341+
corresponding to 0.1 and 0.4 in data coordinateing and will be
343342
automatically scaled when the view limits of the axes change.
344343

345344
.. plot:: users/plotting/examples/anchored_box03.py
@@ -353,10 +352,10 @@ legend (as a matter of fact, this is how the legend is created).
353352
Note that unlike the legend, the ``bbox_transform`` is set
354353
to IdentityTransform by default.
355354

356-
Using Complex Coordinate with Annotation
357-
----------------------------------------
355+
Using Complex Coordinates with Annotations
356+
------------------------------------------
358357

359-
The Annotation in matplotlib support several types of coordinate as
358+
The Annotation in matplotlib supports several types of coordinates as
360359
described in :ref:`annotations-tutorial`. For an advanced user who wants
361360
more control, it supports a few other options.
362361

@@ -392,16 +391,16 @@ more control, it supports a few other options.
392391

393392
Note that it is your responsibility that the extent of the
394393
coordinate artist (*an1* in above example) is determined before *an2*
395-
gets drawn. In most cases, it means that an2 needs to be drawn
394+
gets drawn. In most cases, it means that *an2* needs to be drawn
396395
later than *an1*.
397396

398397

399398
3. A callable object that returns an instance of either
400399
:class:`~matplotlib.transforms.BboxBase` or
401400
:class:`~matplotlib.transforms.Transform`. If a transform is
402-
returned, it is same as 1 and if bbox is returned, it is same
403-
as 2. The callable object should take a single argument of
404-
renderer instance. For example, following two commands give
401+
returned, it is the same as 1 and if a bbox is returned, it is the same
402+
as 2. The callable object should take a single argument of the
403+
renderer instance. For example, the following two commands give
405404
identical results ::
406405

407406
an2 = ax.annotate("Test 2", xy=(1, 0.5), xycoords=an1,
@@ -410,22 +409,21 @@ more control, it supports a few other options.
410409
xytext=(30,0), textcoords="offset points")
411410

412411

413-
4. A tuple of two coordinate specification. The first item is for
414-
x-coordinate and the second is for y-coordinate. For example, ::
412+
4. A tuple of two coordinate specifications. The first item is for the
413+
x-coordinate and the second is for the y-coordinate. For example, ::
415414

416415
annotate("Test", xy=(0.5, 1), xycoords=("data", "axes fraction"))
417416

418-
0.5 is in data coordinate, and 1 is in normalized axes coordinate.
417+
0.5 is in data coordinates, and 1 is in normalized axes coordinates.
419418
You may use an artist or transform as with a tuple. For example,
420419

421420
.. plot:: users/plotting/examples/annotate_simple_coord02.py
422421
:include-source:
423422

424423

425-
5. Sometimes, you want your annotation with some "offset points", but
426-
not from the annotated point but from other
427-
point. :class:`~matplotlib.text.OffsetFrom` is a helper class for such
428-
case.
424+
5. Sometimes, you want your annotation with some "offset points", not from the
425+
annotated point but from some other point.
426+
:class:`~matplotlib.text.OffsetFrom` is a helper class for such cases.
429427

430428
.. plot:: users/plotting/examples/annotate_simple_coord03.py
431429
:include-source:
@@ -435,28 +433,25 @@ more control, it supports a few other options.
435433
Using ConnectorPatch
436434
--------------------
437435

438-
The ConnectorPatch is like an annotation without a text. While the
439-
annotate function is recommended in most of situation, the
440-
ConnectorPatch is useful when you want to connect points in different
441-
axes. ::
436+
The ConnectorPatch is like an annotation without text. While the annotate
437+
function is recommended in most situations, the ConnectorPatch is useful when
438+
you want to connect points in different axes. ::
442439

443440
from matplotlib.patches import ConnectionPatch
444441
xy = (0.2, 0.2)
445442
con = ConnectionPatch(xyA=xy, xyB=xy, coordsA="data", coordsB="data",
446443
axesA=ax1, axesB=ax2)
447444
ax2.add_artist(con)
448445

449-
The above code connects point xy in data coordinate of ``ax1`` to
450-
point xy int data coordinate of ``ax2``. Here is a simple example.
446+
The above code connects point xy in the data coordinates of ``ax1`` to
447+
point xy in the data coordinates of ``ax2``. Here is a simple example.
451448

452449
.. plot:: users/plotting/examples/connect_simple01.py
453450

454451

455-
While the ConnectorPatch instance can be added to any axes, but you
456-
may want it to be added to the axes in the latter (?) of the axes
457-
drawing order to prevent overlap (?) by other axes.
458-
459-
452+
While the ConnectorPatch instance can be added to any axes, you may want to add
453+
it to the axes that is latest in drawing order to prevent overlap by other
454+
axes.
460455

461456

462457
Advanced Topics
@@ -466,7 +461,7 @@ Zoom effect between Axes
466461
------------------------
467462

468463
mpl_toolkits.axes_grid.inset_locator defines some patch classes useful
469-
for interconnect two axes. Understanding the code requires some
464+
for interconnecting two axes. Understanding the code requires some
470465
knowledge of how mpl's transform works. But, utilizing it will be
471466
straight forward.
472467

@@ -478,7 +473,7 @@ Define Custom BoxStyle
478473
----------------------
479474

480475
You can use a custom box style. The value for the ``boxstyle`` can be a
481-
callable object in following forms.::
476+
callable object in the following forms.::
482477

483478
def __call__(self, x0, y0, width, height, mutation_size,
484479
aspect_ratio=1.):
@@ -491,7 +486,7 @@ callable object in following forms.::
491486
- *aspect_ratio* : aspect-ratio for the mutation.
492487
"""
493488
path = ...
494-
return path
489+
return path
495490

496491
Here is a complete example.
497492

@@ -504,6 +499,6 @@ matplotlib.patches.BoxStyle._Base as demonstrated below.
504499
:include-source:
505500

506501

507-
Similarly, you can define custom ConnectionStyle and custom ArrowStyle.
502+
Similarly, you can define a custom ConnectionStyle and a custom ArrowStyle.
508503
See the source code of ``lib/matplotlib/patches.py`` and check
509504
how each style class is defined.

doc/users/colors.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ it can be provided as:
99

1010
* a ``(r, g, b)`` tuple
1111
* a ``(r, g, b, a)`` tuple
12-
* a hex string RGB or RGBA (ex ``'#0F0F0F'`` or ``'#0F0F0F0F'``)
12+
* a hex RGB or RGBA string (ex ``'#0F0F0F'`` or ``'#0F0F0F0F'``)
1313
* a float value in ``[0, 1]`` inclusive for gray level
1414
* one of ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``
1515
* a X11/CSS4 color name
@@ -29,9 +29,9 @@ can be used as a 'single character color' in format-string to
2929
`matplotlib.Axes.plot`.
3030

3131
The single digit is the index into the default property cycle
32-
(``matplotlib.rcParams['axes.prop_cycle']`` to get the color from. If
33-
the property cycle includes ``'color`` then black is returned. The
34-
color is evaluated when the artits is created. For example
32+
(``matplotlib.rcParams['axes.prop_cycle']``). If the property cycle does not
33+
include ``'color`` then black is returned. The color is evaluated when the
34+
artist is created. For example
3535

3636
.. plot::
3737
:include-source: True

doc/users/customizing.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ Defining your own style
2727
-----------------------
2828

2929
You can create custom styles and use them by calling ``style.use`` with the
30-
path or URL to the style sheet. Alternatively, if you add your ``<style-name>.mplstyle``
31-
file to ``mpl_configdir/stylelib``, you can reuse your custom style sheet with a call to
32-
``style.use(<style-name>)``. By default ``mpl_configdir`` should be ``~/.config/matplotlib``,
33-
but you can check where yours is with ``matplotlib.get_configdir()``, you may need to
34-
create this directory. Note that a custom style sheet in ``mpl_configdir/stylelib``
35-
will override a style sheet defined by matplotlib if the styles have the same name.
30+
path or URL to the style sheet. Additionally, if you add your
31+
``<style-name>.mplstyle`` file to ``mpl_configdir/stylelib``, you can reuse
32+
your custom style sheet with a call to ``style.use(<style-name>)``. By default
33+
``mpl_configdir`` should be ``~/.config/matplotlib``, but you can check where
34+
yours is with ``matplotlib.get_configdir()``; you may need to create this
35+
directory. Note that a custom style sheet in ``mpl_configdir/stylelib`` will
36+
override a style sheet defined by matplotlib if the styles have the same name.
3637

3738
For example, you might want to create
3839
``mpl_configdir/stylelib/presentation.mplstyle`` with the following::
@@ -71,7 +72,7 @@ Temporary styling
7172

7273
If you only want to use a style for a specific block of code but don't want
7374
to change the global styling, the style package provides a context manager
74-
for limiting your changes to a specific scope. To isolate the your styling
75+
for limiting your changes to a specific scope. To isolate your styling
7576
changes, you can write something like the following::
7677

7778
>>> import numpy as np

0 commit comments

Comments
 (0)
0