Skip to content

Commit ff227d3

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: lib/matplotlib/tests/__init__.py lib/matplotlib/tests/test_backend_pdf.py lib/matplotlib/tests/test_bbox_tight.py
2 parents b9d1b54 + 0f8a452 commit ff227d3

File tree

7 files changed

+26
-31
lines changed

7 files changed

+26
-31
lines changed

doc/_templates/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ <h4>Other learning resources</h4>
129129

130130
<h4>Need help?</h4>
131131

132+
<p>matplotlib is a welcoming, inclusive project, and we try to follow
133+
the <a href="http://www.python.org/psf/codeofconduct/">Python Software
134+
Foundation Code of Conduct</a> in everything we do.</p>
135+
132136
<p>Check the <a href="{{ pathto('faq/index') }}">faq</a>,
133137
the <a href="{{ pathto('api/index') }}">api</a> docs,
134138
<a href="http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html">mailing

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def rcdefaults():
10381038
the rc file, but mpl's internal params. See rc_file_defaults for
10391039
reloading the default params from the rc file
10401040
"""
1041+
rcParams.clear()
10411042
rcParams.update(rcParamsDefault)
10421043

10431044

lib/matplotlib/tests/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212

1313
def setup():
14-
use('Agg', warn=False) # use Agg backend for these tests
14+
# The baseline images are created in this locale, so we should use
15+
# it during all of the tests.
16+
import locale
17+
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
18+
19+
use('Agg', warn=False) # use Agg backend for these tests
1520

1621
# These settings *must* be hardcoded for running the comparison
1722
# tests and are not necessarily the default values as specified in

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,18 @@
1313
from matplotlib import pyplot as plt
1414
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup
1515

16-
17-
# if 'TRAVIS' not in os.environ:
18-
# @image_comparison(baseline_images=['pdf_use14corefonts'], extensions=['pdf'])
19-
# def test_use14corefonts():
20-
# rcParams['pdf.use14corefonts'] = True
21-
# rcParams['font.family'] = 'sans-serif'
22-
# rcParams['font.size'] = 8
23-
# rcParams['font.sans-serif'] = ['Helvetica']
24-
25-
# title = 'Test PDF backend with option use14corefonts=True'
26-
27-
# text = '''A three-line text positioned just above a blue line
28-
# and containing some French characters and the euro symbol:
29-
# "Merci pépé pour les 10 €"'''
30-
31-
# plt.figure()
32-
# plt.title(title)
33-
# plt.text(0.5, 0.5, text, horizontalalignment='center',
34-
# verticalalignment='bottom',
35-
# fontsize=24)
36-
# plt.axhline(0.5, linewidth=0.5)
16+
if 'TRAVIS' not in os.environ:
17+
@image_comparison(baseline_images=['pdf_use14corefonts'], extensions=['pdf'])
18+
def test_use14corefonts():
19+
rcParams['pdf.use14corefonts'] = True
20+
rcParams['font.family'] = 'sans-serif'
21+
rcParams['font.size'] = 8
22+
rcParams['font.sans-serif'] = ['Helvetica']
23+
rcParams['pdf.compression'] = 0
24+
25+
text = u'''A three-line text positioned just above a blue line
26+
and containing some French characters and the euro symbol:
27+
"Merci pépé pour les 10 €"'''
3728

3829

3930
@cleanup

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77

8-
from matplotlib import rcParams, rcParamsDefault
8+
from matplotlib import rcParams
99
from matplotlib.testing.decorators import image_comparison
1010
import matplotlib.pyplot as plt
1111
import matplotlib.path as mpath
@@ -17,8 +17,6 @@
1717
savefig_kwarg=dict(bbox_inches='tight'), tol=15)
1818
def test_bbox_inches_tight():
1919
#: Test that a figure saved using bbox_inches='tight' is clipped right
20-
rcParams.update(rcParamsDefault)
21-
2220
data = [[ 66386, 174296, 75131, 577908, 32015],
2321
[ 58230, 381139, 78045, 99308, 160454],
2422
[ 89135, 80552, 152558, 497981, 603535],

lib/matplotlib/tests/test_colorbar.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import matplotlib
88
from matplotlib.testing.decorators import image_comparison, knownfailureif
99
import matplotlib.pyplot as plt
10-
from matplotlib import rcParams, rcParamsDefault
10+
from matplotlib import rcParams
1111
from matplotlib.colors import BoundaryNorm
1212
from matplotlib.cm import get_cmap
1313
from matplotlib.colorbar import ColorbarBase
@@ -102,8 +102,6 @@ def _colorbar_extension_length(spacing):
102102
extensions=['png'])
103103
def test_colorbar_extension_shape():
104104
'''Test rectangular colorbar extensions.'''
105-
# Use default params so matplotlibrc doesn't cause the test to fail.
106-
rcParams.update(rcParamsDefault)
107105
# Create figures for uniform and proportionally spaced colorbars.
108106
fig1 = _colorbar_extension_shape('uniform')
109107
fig2 = _colorbar_extension_shape('proportional')
@@ -114,8 +112,6 @@ def test_colorbar_extension_shape():
114112
extensions=['png'])
115113
def test_colorbar_extension_length():
116114
'''Test variable length colorbar extensions.'''
117-
# Use default params so matplotlibrc doesn't cause the test to fail.
118-
rcParams.update(rcParamsDefault)
119115
# Create figures for uniform and proportionally spaced colorbars.
120116
fig1 = _colorbar_extension_length('uniform')
121117
fig2 = _colorbar_extension_length('proportional')

lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def test_image_composite_alpha():
267267
ax.set_ylim([5, 0])
268268

269269

270-
@image_comparison(baseline_images=['rasterize_10dpi'], extensions=['pdf','svg'], tol=1.5e-3, remove_text=True)
270+
@image_comparison(baseline_images=['rasterize_10dpi'], extensions=['pdf','svg'], tol=5e-2, remove_text=True)
271271
def test_rasterize_dpi():
272272
# This test should check rasterized rendering with high output resolution.
273273
# It plots a rasterized line and a normal image with implot. So it will catch

0 commit comments

Comments
 (0)