Skip to content

Commit c32bb0d

Browse files
committed
Merge branch 'v2.x'
Conflicts: lib/matplotlib/lines.py import whitespace issues lib/matplotlib/markers.py whitespace vs _empty_path changes lib/matplotlib/tests/test_axes.py test order issues lib/matplotlib/tests/test_lines.py test order issues lib/mpl_toolkits/tests/test_axes_grid1.py new test vs white space issue setup.py new functionality vs white space issue
2 parents aab6cfd + dc258b3 commit c32bb0d

File tree

8 files changed

+33
-7
lines changed

8 files changed

+33
-7
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,7 @@ def tk_window_focus():
14451445
'matplotlib.tests.test_colorbar',
14461446
'matplotlib.tests.test_colors',
14471447
'matplotlib.tests.test_compare_images',
1448+
'matplotlib.tests.test_container',
14481449
'matplotlib.tests.test_contour',
14491450
'matplotlib.tests.test_dates',
14501451
'matplotlib.tests.test_delaunay',

lib/matplotlib/animation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
756756
# Re-use the savefig DPI for ours if none is given
757757
if dpi is None:
758758
dpi = rcParams['savefig.dpi']
759+
if dpi == 'figure':
760+
dpi = self._fig.dpi
759761

760762
if codec is None:
761763
codec = rcParams['animation.codec']

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,8 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
21412141

21422142
if dpi is None:
21432143
dpi = rcParams['savefig.dpi']
2144+
if dpi == 'figure':
2145+
dpi = self.figure.dpi
21442146

21452147
origDPI = self.figure.dpi
21462148
origfacecolor = self.figure.get_facecolor()

lib/matplotlib/colors.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,11 @@ def process_value(value):
904904
is_scalar = False
905905
result = ma.asarray(value)
906906
if result.dtype.kind == 'f':
907-
if isinstance(value, np.ndarray):
908-
result = result.copy()
907+
# this is overkill for lists of floats, but required
908+
# to support pd.Series as input until we can reliable
909+
# determine if result and value share memory in all cases
910+
# (list, tuple, deque, ndarray, Series, ...)
911+
result = result.copy()
909912
elif result.dtype.itemsize > 2:
910913
result = result.astype(np.float)
911914
else:

lib/matplotlib/container.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from matplotlib.externals import six
55

66
import matplotlib.cbook as cbook
7+
import matplotlib.artist as martist
78

89

910
class Container(tuple):
@@ -31,7 +32,9 @@ def set_remove_method(self, f):
3132
self._remove_method = f
3233

3334
def remove(self):
34-
for c in self:
35+
for c in cbook.flatten(self,
36+
scalarp=lambda x: isinstance(x,
37+
martist.Artist)):
3538
c.remove()
3639

3740
if self._remove_method:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from __future__ import (absolute_import, division, print_function,
2+
unicode_literals)
3+
4+
from matplotlib.externals import six
5+
import matplotlib.pyplot as plt
6+
7+
from matplotlib.testing.decorators import cleanup
8+
9+
10+
@cleanup
11+
def test_stem_remove():
12+
ax = plt.gca()
13+
st = ax.stem([1, 2], [1, 2])
14+
st.remove()

lib/matplotlib/tests/test_lines.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def test_marker_fill_styles():
156156

157157

158158
def test_nan_is_sorted():
159-
# Exercises issue from PR #2744 (NaN throwing warning in _is_sorted)
160159
line = mlines.Line2D([],[])
161160
assert_true(line._is_sorted(np.array([1, 2, 3])))
162161
assert_true(line._is_sorted(np.array([1, np.nan, 3])))

lib/matplotlib/widgets.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ def __init__(self, ax, x, y, marker='o', marker_props=None, useblit=True):
15901590
self.ax = ax
15911591

15921592
props = dict(marker=marker, markersize=7, mfc='w', ls='none',
1593-
alpha=0.5, visible=False)
1593+
alpha=0.5, visible=False, label='_nolegend_')
15941594
props.update(marker_props if marker_props is not None else {})
15951595
self._markers = Line2D(x, y, animated=useblit, **props)
15961596
self.ax.add_line(self._markers)
@@ -1788,11 +1788,13 @@ def __init__(self, ax, onselect, drawtype='box',
17881788
self._edge_order = ['W', 'N', 'E', 'S']
17891789
xe, ye = self.edge_centers
17901790
self._edge_handles = ToolHandles(self.ax, xe, ye, marker='s',
1791-
marker_props=props, useblit=self.useblit)
1791+
marker_props=props,
1792+
useblit=self.useblit)
17921793

17931794
xc, yc = self.center
17941795
self._center_handle = ToolHandles(self.ax, [xc], [yc], marker='s',
1795-
marker_props=props, useblit=self.useblit)
1796+
marker_props=props,
1797+
useblit=self.useblit)
17961798

17971799
self.active_handle = None
17981800

0 commit comments

Comments
 (0)