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

Skip to content

Commit 32f4492

Browse files
committed
Merge remote-tracking branch 'upstream/master' into err-msg-fix
2 parents 952ca40 + 38561b9 commit 32f4492

File tree

23 files changed

+466
-119
lines changed

23 files changed

+466
-119
lines changed

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ per-file-ignores =
8686
tutorials/advanced/transforms_tutorial.py: E402, E501
8787
tutorials/colors/colormaps.py: E501
8888
tutorials/colors/colors.py: E402
89+
tutorials/colors/colormap-manipulation.py: E402
8990
tutorials/intermediate/artists.py: E402, E501
9091
tutorials/intermediate/constrainedlayout_guide.py: E402, E501
9192
tutorials/intermediate/gridspec.py: E402, E501
@@ -114,6 +115,7 @@ per-file-ignores =
114115
examples/color/color_demo.py: E402
115116
examples/color/colorbar_basics.py: E402
116117
examples/color/colormap_reference.py: E402
118+
examples/color/custom_cmap.py: E402
117119
examples/color/named_colors.py: E402
118120
examples/event_handling/data_browser.py: E501
119121
examples/event_handling/path_editor.py: E501
@@ -129,7 +131,6 @@ per-file-ignores =
129131
examples/images_contours_and_fields/contourf_demo.py: E402, E501
130132
examples/images_contours_and_fields/contourf_hatching.py: E402
131133
examples/images_contours_and_fields/contourf_log.py: E402
132-
examples/images_contours_and_fields/custom_cmap.py: E402
133134
examples/images_contours_and_fields/demo_bboximage.py: E402
134135
examples/images_contours_and_fields/image_clip_path.py: E402
135136
examples/images_contours_and_fields/image_demo.py: E402

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|Travis|_ |AppVeyor|_ |Codecov|_ |PyPi|_ |Gitter|_ |NUMFocus|_
1+
|Travis|_ |AppVeyor|_ |Codecov|_ |LGTM|_ |PyPi|_ |Gitter|_ |NUMFocus|_
22

33

44
.. |Travis| image:: https://travis-ci.org/matplotlib/matplotlib.svg?branch=master
@@ -10,6 +10,9 @@
1010
.. |Codecov| image:: https://codecov.io/github/matplotlib/matplotlib/badge.svg?branch=master&service=github
1111
.. _Codecov: https://codecov.io/github/matplotlib/matplotlib?branch=master
1212

13+
.. |LGTM| image:: https://img.shields.io/lgtm/grade/python/g/matplotlib/matplotlib.svg?logo=lgtm&logoWidth=18
14+
.. _LGTM: https://lgtm.com/projects/g/matplotlib/matplotlib
15+
1316
.. |PyPi| image:: https://badge.fury.io/py/matplotlib.svg
1417
.. _PyPi: https://badge.fury.io/py/matplotlib
1518

doc/_static/mpl.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,14 @@ dl.class p.rubric + table.docutils td:first-of-type > strong {
685685
background-color: #eff3f4;
686686
}
687687

688+
/* tables inside class descriptions */
689+
dl.class table.property-table {
690+
width: 85%;
691+
border-spacing: 2px;
692+
border-collapse: collapse;
693+
border: 0px;
694+
}
695+
688696
/* tables inside parameter descriptions */
689697
td.field-body table.property-table {
690698
width: 100%;

examples/axes_grid1/demo_axes_rgb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def demo_rgb2():
7979
for sp1 in ax1.spines.values():
8080
sp1.set_color("w")
8181
for tick in ax1.xaxis.get_major_ticks() + ax1.yaxis.get_major_ticks():
82-
tick.tick1line.set_mec("w")
83-
tick.tick2line.set_mec("w")
82+
tick.tick1line.set_markeredgecolor("w")
83+
tick.tick2line.set_markeredgecolor("w")
8484

8585
return ax
8686

examples/images_contours_and_fields/custom_cmap.py renamed to examples/color/custom_cmap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Creating a colormap from a list of colors
44
=========================================
55
6+
For more detail on creating and manipulating colormaps see
7+
:doc:`/tutorials/colors/colormap-manipulation`.
8+
69
Creating a :doc:`colormap </tutorials/colors/colormaps>`
710
from a list of colors can be done with the
811
:meth:`~.colors.LinearSegmentedColormap.from_list` method of

examples/event_handling/ginput_demo_sgskip.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/event_handling/ginput_manual_clabel_sgskip.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
graphical user interface (for example, using GTK3Agg backend, but not
1111
PS backend).
1212
13-
See also ginput_demo.py
14-
1513
"""
1614

1715
import time

examples/misc/svg_filter_pie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
w.set_gid(w.get_label())
3232

3333
# we don't want to draw the edge of the pie
34-
w.set_ec("none")
34+
w.set_edgecolor("none")
3535

3636
for w in pies[0]:
3737
# create shadow patch

lib/matplotlib/artist.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,17 @@ def set_agg_filter(self, filter_func):
828828
self.stale = True
829829

830830
def draw(self, renderer, *args, **kwargs):
831-
'Derived classes drawing method'
831+
"""
832+
Draw the Artist using the given renderer.
833+
834+
This method will be overridden in the Artist subclasses. Typically,
835+
it is implemented to not have any effect if the Artist is not visible
836+
(`.Artist.get_visible` is *False*).
837+
838+
Parameters
839+
----------
840+
renderer : `.RendererBase` subclass.
841+
"""
832842
if not self.get_visible():
833843
return
834844
self.stale = False
@@ -1161,7 +1171,7 @@ def get_valid_values(self, attr):
11611171
if docstring is None:
11621172
return 'unknown'
11631173

1164-
if docstring.startswith('alias for '):
1174+
if docstring.startswith('Alias for '):
11651175
return None
11661176

11671177
match = self._get_valid_values_regex.search(docstring)
@@ -1231,7 +1241,7 @@ def is_alias(self, o):
12311241
ds = o.__doc__
12321242
if ds is None:
12331243
return False
1234-
return ds.startswith('alias for ')
1244+
return ds.startswith('Alias for ')
12351245

12361246
def aliased_name(self, s):
12371247
"""

lib/matplotlib/backends/backend_pgf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
683683
if mtext and (
684684
(angle == 0 or
685685
mtext.get_rotation_mode() == "anchor") and
686-
mtext.get_va() != "center_baseline"):
686+
mtext.get_verticalalignment() != "center_baseline"):
687687
# if text anchoring can be supported, get the original coordinates
688688
# and add alignment information
689689
pos = mtext.get_unitless_position()
@@ -694,8 +694,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
694694
halign = {"left": "left", "right": "right", "center": ""}
695695
valign = {"top": "top", "bottom": "bottom",
696696
"baseline": "base", "center": ""}
697-
text_args.append(halign[mtext.get_ha()])
698-
text_args.append(valign[mtext.get_va()])
697+
text_args.append(halign[mtext.get_horizontalalignment()])
698+
text_args.append(valign[mtext.get_verticalalignment()])
699699
else:
700700
# if not, use the text layout provided by matplotlib
701701
text_args.append("x=%fin" % (x * f))

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,7 @@ class so far, an alias named ``get_alias`` will be defined; the same will
19151915
return functools.partial(_define_aliases, alias_d)
19161916

19171917
def make_alias(name): # Enforce a closure over *name*.
1918+
@functools.wraps(getattr(cls, name))
19181919
def method(self, *args, **kwargs):
19191920
return getattr(self, name)(*args, **kwargs)
19201921
return method
@@ -1927,7 +1928,7 @@ def method(self, *args, **kwargs):
19271928
for alias in aliases:
19281929
method = make_alias(prefix + prop)
19291930
method.__name__ = prefix + alias
1930-
method.__doc__ = "alias for `{}`".format(prefix + prop)
1931+
method.__doc__ = "Alias for `{}`.".format(prefix + prop)
19311932
setattr(cls, prefix + alias, method)
19321933
if not exists:
19331934
raise ValueError(

lib/matplotlib/cm.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
"""
22
Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.
33
4-
See :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
5-
See :doc:`/tutorials/colors/colormaps` for an in-depth discussion of colormaps.
4+
.. seealso::
5+
6+
:doc:`/gallery/color/colormap_reference` for a list of builtin
7+
colormaps.
8+
9+
:doc:`/tutorials/colors/colormap-manipulation` for examples of how to
10+
make colormaps and
11+
12+
:doc:`/tutorials/colors/colormaps` an in-depth discussion of
13+
choosing colormaps.
14+
15+
:doc:`/tutorials/colors/colormapnorms` for more details about data
16+
normalization
17+
18+
619
"""
720

821
import functools

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def get_facecolor(self):
691691

692692
def get_edgecolor(self):
693693
if cbook._str_equal(self._edgecolors, 'face'):
694-
return self.get_facecolors()
694+
return self.get_facecolor()
695695
else:
696696
return self._edgecolors
697697

lib/matplotlib/colors.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@
66
77
This module includes functions and classes for color specification
88
conversions, and for mapping numbers to colors in a 1-D array of colors called
9-
a colormap. Colormapping typically involves two steps: a data array is first
10-
mapped onto the range 0-1 using an instance of :class:`Normalize` or of a
11-
subclass; then this number in the 0-1 range is mapped to a color using an
12-
instance of a subclass of :class:`Colormap`. Two are provided here:
13-
:class:`LinearSegmentedColormap`, which is used to generate all the built-in
14-
colormap instances, but is also useful for making custom colormaps, and
15-
:class:`ListedColormap`, which is used for generating a custom colormap from a
16-
list of color specifications.
9+
a colormap.
10+
11+
Mapping data onto colors using a colormap typically involves two steps:
12+
a data array is first mapped onto the range 0-1 using a subclass of
13+
:class:`Normalize`, then this number is mapped to a color using
14+
a subclass of :class:`Colormap`. Two are provided here:
15+
:class:`LinearSegmentedColormap`, which uses piecewise-linear interpolation
16+
to define colormaps, and :class:`ListedColormap`, which makes a colormap
17+
from a list of colors.
18+
19+
.. seealso::
20+
21+
:doc:`/tutorials/colors/colormap-manipulation` for examples of how to
22+
make colormaps and
23+
24+
:doc:`/tutorials/colors/colormaps` for a list of built-in colormaps.
25+
26+
:doc:`/tutorials/colors/colormapnorms` for more details about data
27+
normalization
1728
1829
The module also provides functions for checking whether an object can be
1930
interpreted as a color (:func:`is_color_like`), for converting such an object

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def __init__(self,
368368
xy=(0, 0), width=1, height=1,
369369
facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth)
370370
self._set_artist_props(self.patch)
371-
self.patch.set_aa(False)
371+
self.patch.set_antialiased(False)
372372

373373
self.canvas = None
374374
self._suptitle = None

0 commit comments

Comments
 (0)