Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 21ebc3a

Browse filesBrowse files
committed
Merge branch 'pdf-improve' into pdf-gouraud-alpha
Follow the PEP8 naming convention in the new members.
2 parents 0e2b40f + 73de372 commit 21ebc3a
Copy full SHA for 21ebc3a

File tree

Expand file treeCollapse file tree

29 files changed

+204
-132
lines changed
Filter options
Expand file treeCollapse file tree

29 files changed

+204
-132
lines changed

‎.appveyor.yml

Copy file name to clipboardExpand all lines: .appveyor.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install:
6666
- activate test-environment
6767
- echo %PYTHON_VERSION% %TARGET_ARCH%
6868
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
69-
- pip install -q "pytest>=3.4,<4.6" "pytest-cov>=2.3.1" pytest-rerunfailures pytest-timeout pytest-xdist
69+
- pip install -q "pytest>=3.4,!=4.6.0" "pytest-cov>=2.3.1" pytest-rerunfailures pytest-timeout pytest-xdist
7070

7171
# Apply patch to `subprocess` on Python versions > 2 and < 3.6.3
7272
# https://github.com/matplotlib/matplotlib/issues/9176

‎.github/FUNDING.yml

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
custom: https://numfocus.salsalabs.org/donate-to-matplotlib/index.html

‎LICENSE/LICENSE_PAINT

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2000 by Object Craft P/L, Melbourne, Australia.
2+
3+
All Rights Reserved
4+
5+
Permission to use, copy, modify, and distribute this software and its
6+
documentation for any purpose and without fee is hereby granted,
7+
provided that the above copyright notice appear in all copies and that
8+
both that copyright notice and this permission notice appear in
9+
supporting documentation, and that the name of Object Craft
10+
is not be used in advertising or publicity pertaining to
11+
distribution of the software without specific, written prior
12+
permission.
13+
14+
OBJECT CRAFT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15+
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16+
EVENT SHALL OBJECT CRAFT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17+
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
18+
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20+
PERFORMANCE OF THIS SOFTWARE.
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Removals
2+
````````
3+
4+
The following members of ``matplotlib.backends.backend_pdf.PdfFile`` were removed:
5+
6+
- ``nextObject``
7+
- ``nextFont``
8+
- ``nextAlphaState``
9+
- ``nextHatch``
10+
- ``nextImage``
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The *fname* argument to `FontProperties` can now be an `os.PathLike`\s
2+
``````````````````````````````````````````````````````````````````````
3+
4+
e.g. ``FontProperties(fname=pathlib.Path("/path/to/font.ttf"))``.

‎examples/animation/random_walk.py

Copy file name to clipboardExpand all lines: examples/animation/random_walk.py
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515

1616
def gen_rand_line(length, dims=2):
1717
"""
18-
Create a line using a random walk algorithm
19-
20-
length is the number of points for the line.
21-
dims is the number of dimensions the line has.
18+
Create a line using a random walk algorithm.
19+
20+
Parameters
21+
----------
22+
length : int
23+
The number of points of the line.
24+
dims : int
25+
The number of dimensions of the line.
2226
"""
2327
line_data = np.empty((dims, length))
2428
line_data[:, 0] = np.random.rand(dims)

‎examples/animation/strip_chart.py

Copy file name to clipboardExpand all lines: examples/animation/strip_chart.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def update(self, y):
4040

4141

4242
def emitter(p=0.03):
43-
'return a random value with probability p, else 0'
43+
"""Return a random value in [0, 1) with probability p, else 0."""
4444
while True:
4545
v = np.random.rand(1)
4646
if v > p:

‎examples/axisartist/demo_axis_direction.py

Copy file name to clipboardExpand all lines: examples/axisartist/demo_axis_direction.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020

2121
def setup_axes(fig, rect):
22-
"""
23-
polar projection, but in a rectangular box.
24-
"""
22+
"""Polar projection, but in a rectangular box."""
2523

2624
# see demo_curvelinear_grid.py for details
2725
tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform()

‎examples/axisartist/demo_curvelinear_grid2.py

Copy file name to clipboardExpand all lines: examples/axisartist/demo_curvelinear_grid2.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323

2424
def curvelinear_test1(fig):
25-
"""
26-
grid for custom transform.
27-
"""
25+
"""Grid for custom transform."""
2826

2927
def tr(x, y):
3028
sgn = np.sign(x)

‎examples/axisartist/simple_axis_pad.py

Copy file name to clipboardExpand all lines: examples/axisartist/simple_axis_pad.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020

2121
def setup_axes(fig, rect):
22-
"""
23-
polar projection, but in a rectangular box.
24-
"""
22+
"""Polar projection, but in a rectangular box."""
2523

2624
# see demo_curvelinear_grid.py for details
2725
tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform()

‎examples/event_handling/pick_event_demo2.py

Copy file name to clipboardExpand all lines: examples/event_handling/pick_event_demo2.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Pick Event Demo2
44
================
55
6-
compute the mean and standard deviation (stddev) of 100 data sets and plot
7-
mean vs stddev. When you click on one of the mu, sigma points, plot the raw
8-
data from the dataset that generated the mean and stddev.
6+
Compute the mean (mu) and standard deviation (sigma) of 100 data sets and plot
7+
mu vs. sigma. When you click on one of the (mu, sigma) points, plot the raw
8+
data from the dataset that generated this point.
99
"""
1010
import numpy as np
1111
import matplotlib.pyplot as plt

‎examples/images_contours_and_fields/interpolation_methods.py

Copy file name to clipboardExpand all lines: examples/images_contours_and_fields/interpolation_methods.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
2-
=================================
3-
Interpolations for imshow/matshow
4-
=================================
2+
=========================
3+
Interpolations for imshow
4+
=========================
55
66
This example displays the difference between interpolation methods for
7-
:meth:`~.axes.Axes.imshow` and :meth:`~.axes.Axes.matshow`.
7+
:meth:`~.axes.Axes.imshow`.
88
9-
If `interpolation` is None, it defaults to the ``image.interpolation``
10-
:doc:`rc parameter </tutorials/introductory/customizing>`.
11-
If the interpolation is ``'none'``, then no interpolation is performed
12-
for the Agg, ps and pdf backends. Other backends will default to ``'nearest'``.
9+
If `interpolation` is None, it defaults to the :rc:`image.interpolation`
10+
(default: ``'nearest'``). If the interpolation is ``'none'``, then no
11+
interpolation is performed for the Agg, ps and pdf backends. Other backends
12+
will default to ``'nearest'``.
1313
1414
For the Agg, ps and pdf backends, ``interpolation = 'none'`` works well when a
1515
big image is scaled down, while ``interpolation = 'nearest'`` works well when

‎examples/text_labels_and_annotations/font_file.py

Copy file name to clipboardExpand all lines: examples/text_labels_and_annotations/font_file.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
:doc:`/gallery/text_labels_and_annotations/fonts_demo`.
1616
"""
1717

18-
import os
19-
from matplotlib import font_manager as fm, rcParams
18+
from pathlib import Path
19+
20+
import matplotlib as mpl
21+
from matplotlib import font_manager as fm
2022
import matplotlib.pyplot as plt
2123

2224
fig, ax = plt.subplots()
2325

24-
fpath = os.path.join(rcParams["datapath"], "fonts/ttf/cmr10.ttf")
26+
fpath = Path(mpl.get_data_path(), "fonts/ttf/cmr10.ttf")
2527
prop = fm.FontProperties(fname=fpath)
26-
fname = os.path.split(fpath)[1]
27-
ax.set_title('This is a special font: {}'.format(fname), fontproperties=prop)
28+
ax.set_title(f'This is a special font: {fpath.name}', fontproperties=prop)
2829
ax.set_xlabel('This is the default font')
2930

3031
plt.show()

‎examples/widgets/span_selector.py

Copy file name to clipboardExpand all lines: examples/widgets/span_selector.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ def onselect(xmin, xmax):
3838
ax2.set_ylim(thisy.min(), thisy.max())
3939
fig.canvas.draw()
4040

41-
# Set useblit=True on most backends for enhanced performance.
41+
#############################################################################
42+
# .. note::
43+
#
44+
# If the SpanSelector object is garbage collected you will lose the
45+
# interactivity. You must keep a hard reference to it to prevent this.
46+
#
47+
48+
4249
span = SpanSelector(ax1, onselect, 'horizontal', useblit=True,
4350
rectprops=dict(alpha=0.5, facecolor='red'))
51+
# Set useblit=True on most backends for enhanced performance.
4452

4553

4654
plt.show()

‎lib/matplotlib/afm.py

Copy file name to clipboardExpand all lines: lib/matplotlib/afm.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
1414
It is pretty easy to use, and requires only built-in python libs:
1515
16-
>>> from matplotlib import rcParams
16+
>>> import matplotlib as mpl
1717
>>> import os.path
18-
>>> afm_fname = os.path.join(rcParams['datapath'],
18+
>>> afm_fname = os.path.join(mpl.get_data_path(),
1919
... 'fonts', 'afm', 'ptmr8a.afm')
2020
>>>
2121
>>> from matplotlib.afm import AFM

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6309,6 +6309,9 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
63096309
ret.set_clim(vmin, vmax)
63106310
elif np.ndim(C) == 2: # C.ndim == 3 is RGB(A) so doesn't need scaling.
63116311
ret.autoscale_None()
6312+
if ret.get_clip_path() is None:
6313+
# image does not already have clipping set, clip to axes patch
6314+
ret.set_clip_path(self.patch)
63126315

63136316
ret.sticky_edges.x[:] = [xl, xr]
63146317
ret.sticky_edges.y[:] = [yb, yt]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.