Skip to content

Commit b76b38b

Browse files
committed
DOC: address comments
1 parent 4a88a70 commit b76b38b

File tree

4 files changed

+70
-65
lines changed

4 files changed

+70
-65
lines changed

doc/users/annotations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ coordinates, one could do::
5151
)
5252

5353
For physical coordinate systems (points or pixels) the origin is the
54-
(bottom, left) of the figure or axes.
54+
bottom-left of the figure or axes.
5555

5656
Optionally, you can enable drawing of an arrow from the text to the annotated
5757
point by giving a dictionary of arrow properties in the optional keyword

doc/users/dflt_style_changes.rst

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ The behavior of the PS and Agg backends was DPI dependent, thus::
444444
mpl.rcParams['hatch.linewidth'] = 1.0 / dpi # previous ps and Agg hatch linewidth
445445

446446

447-
There is no API level control of the hacth linewidth.
447+
There is no API level control of the hatch linewidth.
448448

449449

450450
.. _default_changes_font:
@@ -460,9 +460,9 @@ Sans". "DejaVu Sans" is an improvement on "Bistream Vera Sans" that
460460
adds more international and math characters, but otherwise has the
461461
same appearance. Latin, Greek, Cyrillic, Armenian, Georgian, Hebrew,
462462
and Arabic are `all supported
463-
<http://dejavu-fonts.org/wiki/Main_Page>`__ (but right-to-left render
463+
<http://dejavu-fonts.org/wiki/Main_Page>`__ (but right-to-left rendering
464464
is still not handled by matplotlib). In addition , DejaVu contains a
465-
sub-set of emoji symbols
465+
sub-set of emoji symbols.
466466

467467
.. plot::
468468

@@ -506,7 +506,7 @@ TeX backend is used (i.e. ``text.usetex`` is ``True``).
506506

507507
fig, ax = plt.subplots(tight_layout=True, figsize=(3, 3))
508508

509-
ax.plot(range(15), label='int: $15 \int_0^\infty dx$')
509+
ax.plot(range(15), label=r'int: $15 \int_0^\infty dx$')
510510
ax.legend()
511511
ax.set_title('classic')
512512

@@ -518,7 +518,7 @@ TeX backend is used (i.e. ``text.usetex`` is ``True``).
518518

519519
fig, ax = plt.subplots(tight_layout=True, figsize=(3, 3))
520520

521-
ax.plot(range(15), label='int: $15 \int_0^\infty dx$')
521+
ax.plot(range(15), label=r'int: $15 \int_0^\infty dx$')
522522
ax.legend()
523523
ax.set_title('v2.0')
524524

@@ -531,7 +531,7 @@ To revert to the old behavior set the::
531531

532532
or by setting::
533533

534-
mathetxt.fontset: cm
534+
mathtext.fontset: cm
535535
mathtext.rm : serif
536536

537537

@@ -556,7 +556,6 @@ Legends
556556
.. plot::
557557

558558
import matplotlib as mpl
559-
import numpy as np
560559
import matplotlib.pyplot as plt
561560
import numpy as np
562561

@@ -567,8 +566,8 @@ Legends
567566
x = range(N)
568567
y = np.cumsum(np.random.randn(N) )
569568
ln, = ax.plot(x, y, marker='s',
570-
linestyle='-', label='plot')
571-
ax.fill_between(x, y, 0, label='fill', alpha=.5, color=ln.get_color())
569+
linestyle='-', label='plot')
570+
ax.fill_between(x, y, 0, label='fill', alpha=.5, color=ln.get_color())
572571
ax.scatter(N*np.random.rand(N), np.random.rand(N), label='scatter')
573572
ax.set_title(title)
574573
ax.legend()
@@ -605,9 +604,9 @@ or by setting::
605604
legend.loc : upper right
606605
legend.numpoints : 2 # the number of points in the legend line
607606
legend.fontsize : large
608-
legend.framealpha : None # opacity of of legend frame
607+
legend.framealpha : None # opacity of legend frame
609608
legend.scatterpoints : 3 # number of scatter points
610-
legend.edgecolor : inherit # legend edge color (when None inherits from axes.facecolor)
609+
legend.edgecolor : inherit # legend edge color (when 'inherit' uses axes.edgecolor)
611610

612611
in your :file:`matplotlibrc` file.
613612

@@ -617,9 +616,9 @@ Image
617616
Interpolation
618617
-------------
619618

620-
The default interpolation method for `~matplotlib.axes.Axes.imshow` is now
621-
``'nearest'`` and by default resamples the data to both up and down sample
622-
then input before color mapping.
619+
The default interpolation method for `~matplotlib.axes.Axes.imshow` is
620+
now ``'nearest'`` and by default resamples the data (both up and down
621+
sampling) before color mapping.
623622

624623

625624
.. plot::
@@ -645,21 +644,6 @@ then input before color mapping.
645644
demo(ax1, classic_rcparams, 'classic')
646645
demo(ax2, {}, 'v2.0')
647646

648-
The default value for the rcParam ``image.resample`` is now ``True``.
649-
This will apply interpolation for both upsampling and downsampling
650-
of an image. ``image.interpolation``, is now ``nearest``.
651-
652-
Previously, the input data was normalized, then color mapped, and the
653-
resampled to the resolution required for the screen. This means that
654-
the final resampling was being done in color space. Because the color
655-
maps are not always linear in RGB space this can result in colors not
656-
in the color map appearing in the final image. This bug was addressed
657-
by an almost complete overhaul of how the image handling code works.
658-
The input data is now normalized, then resampled to the correct
659-
resolution (in scaled dataspace), and then finally color mapped to
660-
RGBA space which prevents any colors not in the color map from
661-
appearing in the final image (if your viewer subsequently resamples
662-
the image the artifact may reappear).
663647

664648
To restore the previous behavior set::
665649

@@ -673,6 +657,24 @@ or set::
673657

674658
in your :file:`matplotlibrc` file.
675659

660+
Colormapping pipeline
661+
---------------------
662+
663+
Previously, the input data was normalized, then color mapped, and then
664+
resampled to the resolution required for the screen. This meant that
665+
the final resampling was being done in color space. Because the color
666+
maps are not generally linear in RGB space colors not in the color map
667+
may appear in the final image. This bug was addressed by an almost
668+
complete overhaul of how the image handling code works.
669+
670+
The input data is now normalized, then resampled to the correct
671+
resolution (in normalized dataspace), and then finally color mapped to
672+
RGB space. This ensures only colors actually in the color map appear
673+
in the final image (if your viewer subsequently resamples the image
674+
the artifact may reappear).
675+
676+
The previous behavior can not be restored.
677+
676678

677679
Shading
678680
-------

doc/users/text_props.rst

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ commands (e.g., :func:`~matplotlib.pyplot.title`,
1212
========================== ======================================================================================================================
1313
Property Value Type
1414
========================== ======================================================================================================================
15-
alpha `float`
16-
backgroundcolor any matplotlib :ref:`color <colors>`
17-
bbox `~matplotlib.patches.Rectangle` prop dict plus key ``'pad'`` which is a pad in points
18-
clip_box a matplotlib.transform.Bbox instance
19-
clip_on [True | False]
20-
clip_path a `~matplotlib.path.Path` instance and a `~matplotlib.transforms.Transform` instance, a `~matplotlib.patches.Patch`
21-
color any matplotlib :ref:`color <colors>`
22-
family [ ``'serif'`` | ``'sans-serif'`` | ``'cursive'`` | ``'fantasy'`` | ``'monospace'`` ]
23-
fontproperties a `~matplotlib.font_manager.FontProperties` instance
15+
alpha `float`
16+
backgroundcolor any matplotlib :ref:`color <colors>`
17+
bbox `~matplotlib.patches.Rectangle` prop dict plus key ``'pad'`` which is a pad in points
18+
clip_box a matplotlib.transform.Bbox instance
19+
clip_on [True | False]
20+
clip_path a `~matplotlib.path.Path` instance and a `~matplotlib.transforms.Transform` instance, a `~matplotlib.patches.Patch`
21+
color any matplotlib :ref:`color <colors>`
22+
family [ ``'serif'`` | ``'sans-serif'`` | ``'cursive'`` | ``'fantasy'`` | ``'monospace'`` ]
23+
fontproperties a `~matplotlib.font_manager.FontProperties` instance
2424
horizontalalignment or ha [ ``'center'`` | ``'right'`` | ``'left'`` ]
25-
label any string
26-
linespacing `float`
27-
multialignment [``'left'`` | ``'right'`` | ``'center'`` ]
28-
name or fontname string e.g., [``'Sans'`` | ``'Courier'`` | ``'Helvetica'`` ...]
29-
picker [None|float|boolean|callable]
30-
position (x, y)
31-
rotation [ angle in degrees | ``'vertical'`` | ``'horizontal'`` ]
32-
size or fontsize [ size in points | relative size, e.g., ``'smaller'``, ``'x-large'`` ]
33-
style or fontstyle [ ``'normal'`` | ``'italic'`` | ``'oblique'`` ]
34-
text string or anything printable with '%s' conversion
35-
transform a `~matplotlib.transforms.Transform` instance
36-
variant [ ``'normal'`` | ``'small-caps'`` ]
37-
verticalalignment or va [ ``'center'`` | ``'top'`` | ``'bottom'`` | ``'baseline'`` ]
38-
visible [True | False]
39-
weight or fontweight [ ``'normal'`` | ``'bold'`` | ``'heavy'`` | ``'light'`` | ``'ultrabold'`` | ``'ultralight'``]
40-
x `float`
41-
y `float`
42-
zorder any number
25+
label any string
26+
linespacing `float`
27+
multialignment [``'left'`` | ``'right'`` | ``'center'`` ]
28+
name or fontname string e.g., [``'Sans'`` | ``'Courier'`` | ``'Helvetica'`` ...]
29+
picker [None|float|boolean|callable]
30+
position (x, y)
31+
rotation [ angle in degrees | ``'vertical'`` | ``'horizontal'`` ]
32+
size or fontsize [ size in points | relative size, e.g., ``'smaller'``, ``'x-large'`` ]
33+
style or fontstyle [ ``'normal'`` | ``'italic'`` | ``'oblique'`` ]
34+
text string or anything printable with '%s' conversion
35+
transform a `~matplotlib.transforms.Transform` instance
36+
variant [ ``'normal'`` | ``'small-caps'`` ]
37+
verticalalignment or va [ ``'center'`` | ``'top'`` | ``'bottom'`` | ``'baseline'`` ]
38+
visible [True | False]
39+
weight or fontweight [ ``'normal'`` | ``'bold'`` | ``'heavy'`` | ``'light'`` | ``'ultrabold'`` | ``'ultralight'``]
40+
x `float`
41+
y `float`
42+
zorder any number
4343
========================== ======================================================================================================================
4444

4545

@@ -66,10 +66,11 @@ upper right.
6666
Default Font
6767
==============
6868

69-
The base default font is controlled by a set of rcParams
70-
69+
The base default font is controlled by a set of rcParams:
7170

7271
+---------------------+----------------------------------------------------+
72+
| rcParam | usage |
73+
+=====================+====================================================+
7374
| ``'font.family'`` | List of either names of font or ``{'cursive', |
7475
| | 'fantasy', 'monospace', 'sans', 'sans serif', |
7576
| | 'sans-serif', 'serif'}``. |
@@ -97,10 +98,12 @@ The base default font is controlled by a set of rcParams
9798

9899
The mapping between the family aliases (``{'cursive', 'fantasy',
99100
'monospace', 'sans', 'sans serif', 'sans-serif', 'serif'}``) and actual font names
100-
is controlled by the following rcParms
101+
is controlled by the following rcParams:
101102

102103

103104
+------------------------------------------+--------------------------------+
105+
| family alias | rcParam with mappings |
106+
+==========================================+================================+
104107
| ``'serif'`` | ``'font.serif'`` |
105108
+------------------------------------------+--------------------------------+
106109
| ``'monospace'`` | ``'font.monospace'`` |
@@ -115,8 +118,8 @@ is controlled by the following rcParms
115118

116119
which are lists of font names.
117120

118-
Text with with non-latin glyphs
119-
===============================
121+
Text with non-latin glyphs
122+
==========================
120123

121124
As of v2.0 the :ref:`default font <default_changes_font>` contains
122125
glyphs for many western alphabets, but still does not cover all of the

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ legend.borderaxespad : 0.5 # the border between the axes and legend edge in fr
290290
legend.columnspacing : 2. # the border between the axes and legend edge in fraction of fontsize
291291
legend.shadow : False
292292
legend.frameon : True # whether or not to draw a frame around legend
293-
legend.framealpha : None # opacity of of legend frame
293+
legend.framealpha : None # opacity of legend frame
294294
legend.scatterpoints : 3 # number of scatter points
295-
legend.facecolor : inherit # legend background color (when None inherits from axes.facecolor)
296-
legend.edgecolor : inherit # legend edge color (when None inherits from axes.facecolor)
295+
legend.facecolor : inherit # legend background color (when 'inherit' uses axes.facecolor)
296+
legend.edgecolor : inherit # legend edge color (when 'inherit' uses axes.edgecolor)
297297

298298

299299

0 commit comments

Comments
 (0)