Skip to content

Commit b5b2b2a

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: INSTALL
2 parents 2e3419a + 5f7ae22 commit b5b2b2a

File tree

6 files changed

+65
-32
lines changed

6 files changed

+65
-32
lines changed

INSTALL

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,6 @@ the libraries themselves.
185185
:term:`numpy` |minimum_numpy_version| (or later)
186186
array support for python (`download numpy <http://numpy.org>`_)
187187

188-
libpng 1.2 (or later)
189-
library for loading and saving :term:`PNG` files (`download
190-
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
191-
zlib. If you are a Windows user, you can ignore this because we
192-
build support into the matplotlib single-click installer
193-
194-
:term:`freetype` 1.4 (or later)
195-
library for reading true type font files. If you are a windows
196-
user, you can ignore this since we build support into the
197-
matplotlib single click installer.
198-
199188
:term:`dateutil` 1.1 or later
200189
Provides extensions to python datetime handling. If using pip,
201190
easy_install or installing from source, the installer will attempt
@@ -209,13 +198,29 @@ libpng 1.2 (or later)
209198
using pip, easy_install or installing from source, the installer
210199
will attempt to download and install `pyparsing` from PyPI.
211200

201+
<<<<<<< HEAD
212202
**Optional dependencies**
213203

214204
`Pillow http://python-imaging.github.io/`__
215205
If Pillow is installed, matplotlib can read and write a larger
216206
selection of image file formats.
217207

218208
**Optional GUI frameworks**
209+
=======
210+
libpng 1.2 (or later)
211+
library for loading and saving :term:`PNG` files (`download
212+
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
213+
zlib. If you are a Windows user, you can ignore this because we
214+
build support into the matplotlib single-click installer
215+
216+
:term:`freetype` 1.4 (or later)
217+
library for reading true type font files. If you are a windows
218+
user, you can ignore this since we build support into the
219+
matplotlib single click installer.
220+
221+
222+
**Optional**
223+
>>>>>>> upstream/v1.3.x
219224

220225
These are optional packages which you may want to install to use
221226
matplotlib with a user interface toolkit. See

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def matplotlib_fname():
754754
"Found matplotlib configuration in ~/.matplotlib/. "
755755
"To conform with the XDG base directory standard, "
756756
"this configuration location has been deprecated "
757-
"on Linux, and the new location is now %r/matplotlib/. "
757+
"on Linux, and the new location is now %s/matplotlib/. "
758758
"Please move your configuration there to ensure that "
759759
"matplotlib will continue to find it in the future." %
760760
_get_xdg_config_dir())

lib/matplotlib/axes/_axes.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,18 +1238,24 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12381238
colls.append(coll)
12391239

12401240
if len(positions) > 0:
1241-
minpos = min(position.min() for position in positions)
1242-
maxpos = max(position.max() for position in positions)
1243-
1244-
minline = (lineoffsets - linelengths).min()
1245-
maxline = (lineoffsets + linelengths).max()
1246-
1247-
if colls[0].is_horizontal():
1248-
corners = (minpos, minline), (maxpos, maxline)
1249-
else:
1250-
corners = (minline, minpos), (maxline, maxpos)
1251-
self.update_datalim(corners)
1252-
self.autoscale_view()
1241+
# try to get min/max
1242+
min_max = [(np.min(_p), np.max(_p)) for _p in positions
1243+
if len(_p) > 0]
1244+
# if we have any non-empty positions, try to autoscale
1245+
if len(min_max) > 0:
1246+
mins, maxes = zip(*min_max)
1247+
minpos = np.min(mins)
1248+
maxpos = np.max(maxes)
1249+
1250+
minline = (lineoffsets - linelengths).min()
1251+
maxline = (lineoffsets + linelengths).max()
1252+
1253+
if colls[0].is_horizontal():
1254+
corners = (minpos, minline), (maxpos, maxline)
1255+
else:
1256+
corners = (minline, minpos), (maxline, maxpos)
1257+
self.update_datalim(corners)
1258+
self.autoscale_view()
12531259

12541260
return colls
12551261

@@ -4670,6 +4676,9 @@ def pcolor(self, *args, **kwargs):
46704676
*alpha*: ``0 <= scalar <= 1`` or *None*
46714677
the alpha blending value
46724678
4679+
*snap*: bool
4680+
Whether to snap the mesh to pixel boundaries.
4681+
46734682
Return value is a :class:`matplotlib.collections.Collection`
46744683
instance.
46754684
@@ -4819,6 +4828,8 @@ def pcolor(self, *args, **kwargs):
48194828
ec.lower() == "none"):
48204829
kwargs['antialiaseds'] = False
48214830

4831+
kwargs.setdefault('snap', False)
4832+
48224833
collection = mcoll.PolyCollection(verts, **kwargs)
48234834

48244835
collection.set_alpha(alpha)

lib/matplotlib/lines.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def draw(self, renderer):
536536
self._set_gc_clip(gc)
537537

538538
ln_color_rgba = self._get_rgba_ln_color()
539-
gc.set_foreground(ln_color_rgba)
539+
gc.set_foreground(ln_color_rgba, isRGBA=True)
540540
gc.set_alpha(ln_color_rgba[3])
541541

542542
gc.set_antialiased(self._antialiased)
@@ -571,7 +571,7 @@ def draw(self, renderer):
571571
edgecolor = self.get_markeredgecolor()
572572
if is_string_like(edgecolor) and edgecolor.lower() == 'none':
573573
gc.set_linewidth(0)
574-
gc.set_foreground(rgbaFace)
574+
gc.set_foreground(rgbaFace, isRGBA=True)
575575
else:
576576
gc.set_foreground(edgecolor)
577577
gc.set_linewidth(self._markeredgewidth)
@@ -1019,12 +1019,7 @@ def _get_rgba_face(self, alt=False):
10191019
return rgbaFace
10201020

10211021
def _get_rgba_ln_color(self, alt=False):
1022-
ln_color = self._color
1023-
if is_string_like(ln_color) and ln_color.lower() == 'none':
1024-
rgba_ln = None
1025-
else:
1026-
rgba_ln = colorConverter.to_rgba(ln_color, self._alpha)
1027-
return rgba_ln
1022+
return colorConverter.to_rgba(self._color, self._alpha)
10281023

10291024
# some aliases....
10301025
def set_aa(self, val):

lib/matplotlib/tests/test_axes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,14 @@ def test_eventplot():
16821682
num_collections = len(colls)
16831683
np.testing.assert_equal(num_collections, num_datasets)
16841684

1685+
1686+
@cleanup
1687+
def test_empty_eventplot():
1688+
fig, ax = plt.subplots(1, 1)
1689+
ax.eventplot([[]], colors=[(0.0, 0.0, 0.0, 0.0)])
1690+
plt.draw()
1691+
1692+
16851693
@image_comparison(baseline_images=['vertex_markers'], extensions=['png'],
16861694
remove_text=True)
16871695
def test_vertex_markers():
@@ -1774,6 +1782,7 @@ def test_mixed_collection():
17741782
ax.set_xlim(0, 16)
17751783
ax.set_ylim(0, 16)
17761784

1785+
17771786
@cleanup
17781787
def test_subplot_key_hash():
17791788
ax = plt.subplot(np.float64(5.5), np.int64(1), np.float64(1.2))

lib/matplotlib/tests/test_lines.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ def test_set_line_coll_dash():
7171
assert True
7272

7373

74+
@cleanup
75+
def test_line_colors():
76+
fig = plt.figure()
77+
ax = fig.add_subplot(1, 1, 1)
78+
ax.plot(range(10), color='none')
79+
ax.plot(range(10), color='r')
80+
ax.plot(range(10), color='.3')
81+
ax.plot(range(10), color=(1, 0, 0, 1))
82+
ax.plot(range(10), color=(1, 0, 0))
83+
fig.canvas.draw()
84+
assert True
85+
86+
7487
@image_comparison(baseline_images=['line_collection_dashes'], remove_text=True)
7588
def test_set_line_coll_dash_image():
7689
fig = plt.figure()

0 commit comments

Comments
 (0)