Skip to content

Commit 2d7c5ad

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.x'
Conflicts: .mailmap - Kept version on master
2 parents 4e21b9a + 2cec8c2 commit 2d7c5ad

File tree

8 files changed

+27
-10
lines changed

8 files changed

+27
-10
lines changed

doc/_templates/citing.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ <h1>Citing matplotlib</h1>
2929

3030
<h2>DOIs</h2>
3131
<dl>
32+
<dt>v1.5.2</dt><dd><a href="http://dx.doi.org/10.5281/zenodo.56926"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.56926.svg" alt="10.5281/zenodo.56926"></a></dd>
3233
<dt>v1.5.1</dt><dd><a href="http://dx.doi.org/10.5281/zenodo.44579"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.44579.svg" alt="10.5281/zenodo.44579"></a></dd>
3334
<dt>v1.5.0</dt><dd><a href="http://dx.doi.org/10.5281/zenodo.32914"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.32914.svg" alt="10.5281/zenodo.32914"></a></dd>
3435
<dt>v1.4.3</dt><dd><a href="http://dx.doi.org/10.5281/zenodo.15423"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.15423.svg" alt="10.5281/zenodo.15423"></a></dd>

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
('axisartist', 'axisartist toolkit'),
140140
('units', 'units'),
141141
('widgets', 'widgets'),
142+
('misc', 'Miscellaneous examples'),
142143
]
143144

144145

examples/misc/image_thumbnail.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- noplot -*-
12
"""
23
You can use matplotlib to generate thumbnails from existing images.
34
matplotlib natively supports PNG files on the input side, and other

examples/misc/longshort.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
csv file, computing the daily returns, appending the results to the
44
record arrays, joining on date
55
"""
6-
import urllib
6+
from six.moves import urllib
77
import numpy as np
88
import matplotlib.pyplot as plt
99
import matplotlib.mlab as mlab
1010

1111
# grab the price data off yahoo
12-
u1 = urllib.urlretrieve('http://ichart.finance.yahoo.com/table.csv?s=AAPL&d=9&e=14&f=2008&g=d&a=8&b=7&c=1984&ignore=.csv')
13-
u2 = urllib.urlretrieve('http://ichart.finance.yahoo.com/table.csv?s=GOOG&d=9&e=14&f=2008&g=d&a=8&b=7&c=1984&ignore=.csv')
12+
u1 = urllib.request.urlretrieve('http://ichart.finance.yahoo.com/table.csv?s=AAPL&d=9&e=14&f=2008&g=d&a=8&b=7&c=1984&ignore=.csv')
13+
u2 = urllib.request.urlretrieve('http://ichart.finance.yahoo.com/table.csv?s=GOOG&d=9&e=14&f=2008&g=d&a=8&b=7&c=1984&ignore=.csv')
1414

1515
# load the CSV files into record arrays
16-
r1 = mlab.csv2rec(file(u1[0]))
17-
r2 = mlab.csv2rec(file(u2[0]))
16+
r1 = mlab.csv2rec(open(u1[0]))
17+
r2 = mlab.csv2rec(open(u2[0]))
1818

1919
# compute the daily returns and add these columns to the arrays
2020
gains1 = np.zeros_like(r1.adj_close)

examples/misc/multiprocess.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- noplot -*-
12
# Demo of using multiprocessing for generating data in one process and plotting
23
# in another.
34
# Written by Robert Cimrman

examples/misc/rc_traits.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- noplot -*-
12
# Here is some example code showing how to define some representative
23
# rc properties and construct a matplotlib artist using traits.
34
# matplotlib does not ship with enthought.traits, so you will need to

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3553,6 +3553,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
35533553
'dotted': ':'
35543554
}
35553555

3556+
zorder = mlines.Line2D.zorder
3557+
zdelta = 0.1
35563558
# box properties
35573559
if patch_artist:
35583560
final_boxprops = dict(
@@ -3569,6 +3571,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
35693571
color=rcParams['boxplot.boxprops.color'],
35703572
)
35713573

3574+
final_boxprops['zorder'] = zorder
35723575
if boxprops is not None:
35733576
final_boxprops.update(boxprops)
35743577

@@ -3585,9 +3588,11 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
35853588
color=rcParams['boxplot.capprops.color'],
35863589
)
35873590

3591+
final_capprops['zorder'] = zorder
35883592
if capprops is not None:
35893593
final_capprops.update(capprops)
35903594

3595+
final_whiskerprops['zorder'] = zorder
35913596
if whiskerprops is not None:
35923597
final_whiskerprops.update(whiskerprops)
35933598

@@ -3602,6 +3607,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
36023607
markersize=rcParams['boxplot.flierprops.markersize'],
36033608
)
36043609

3610+
final_flierprops['zorder'] = zorder
36053611
# flier (outlier) properties
36063612
if flierprops is not None:
36073613
final_flierprops.update(flierprops)
@@ -3612,6 +3618,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
36123618
linewidth=rcParams['boxplot.medianprops.linewidth'],
36133619
color=rcParams['boxplot.medianprops.color'],
36143620
)
3621+
final_medianprops['zorder'] = zorder + zdelta
36153622
if medianprops is not None:
36163623
final_medianprops.update(medianprops)
36173624

@@ -3630,13 +3637,14 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
36303637
markeredgecolor=rcParams['boxplot.meanprops.markeredgecolor'],
36313638
markersize=rcParams['boxplot.meanprops.markersize'],
36323639
)
3640+
final_meanprops['zorder'] = zorder + zdelta
36333641
if meanprops is not None:
36343642
final_meanprops.update(meanprops)
36353643

36363644
def to_vc(xs, ys):
36373645
# convert arguments to verts and codes
36383646
verts = []
3639-
#codes = []
3647+
36403648
for xi, yi in zip(xs, ys):
36413649
verts.append((xi, yi))
36423650
verts.append((0, 0)) # ignored

lib/matplotlib/mlab.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,8 +2385,10 @@ def rec_append_fields(rec, names, arrs, dtypes=None):
23852385
dtypes = dtypes * len(arrs)
23862386
else:
23872387
raise ValueError("dtypes must be None, a single dtype or a list")
2388-
2389-
newdtype = np.dtype(rec.dtype.descr + list(zip(names, dtypes)))
2388+
old_dtypes = rec.dtype.descr
2389+
if six.PY2:
2390+
old_dtypes = [(name.encode('utf-8'), dt) for name, dt in old_dtypes]
2391+
newdtype = np.dtype(old_dtypes + list(zip(names, dtypes)))
23902392
newrec = np.recarray(rec.shape, dtype=newdtype)
23912393
for field in rec.dtype.fields:
23922394
newrec[field] = rec[field]
@@ -2594,8 +2596,10 @@ def mapped_r2field(name):
25942596
if desc[0] not in key]
25952597
r2desc = [(mapped_r2field(desc[0]), desc[1]) for desc in r2.dtype.descr
25962598
if desc[0] not in key]
2597-
newdtype = np.dtype(keydesc + r1desc + r2desc)
2598-
2599+
all_dtypes = keydesc + r1desc + r2desc
2600+
if six.PY2:
2601+
all_dtypes = [(name.encode('utf-8'), dt) for name, dt in all_dtypes]
2602+
newdtype = np.dtype(all_dtypes)
25992603
newrec = np.recarray((common_len + left_len + right_len,), dtype=newdtype)
26002604

26012605
if defaults is not None:

0 commit comments

Comments
 (0)