Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2269e22

Browse files
committed
Be more conservative about changes
1 parent 3ac2872 commit 2269e22

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

lib/matplotlib/contour.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
793793

794794
def __init__(self, ax, *args,
795795
levels=None, filled=False, linewidths=None, linestyles=None,
796-
hatches=(None,), alpha=None, origin=None, extent=None,
796+
alpha=None, origin=None, extent=None,
797797
cmap=None, colors=None, norm=None, vmin=None, vmax=None,
798798
extend='neither', antialiased=False,
799799
**kwargs):
@@ -846,7 +846,7 @@ def __init__(self, ax, *args,
846846
self.filled = filled
847847
self.linewidths = linewidths
848848
self.linestyles = linestyles
849-
self.hatches = hatches
849+
self.hatches = kwargs.pop('hatches', [None])
850850
self.alpha = alpha
851851
self.origin = origin
852852
self.extent = extent

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,8 +1572,8 @@ def plot(self, xs, ys, *args, zdir='z', **kwargs):
15721572

15731573
plot3D = plot
15741574

1575-
def plot_surface(self, X, Y, Z, *args, cmap=None, norm=None, vmin=None,
1576-
vmax=None, linewidth=None, lightsource=None, **kwargs):
1575+
def plot_surface(self, X, Y, Z, *args, norm=None, vmin=None,
1576+
vmax=None, lightsource=None, **kwargs):
15771577
"""
15781578
Create a surface plot.
15791579
@@ -1671,6 +1671,7 @@ def plot_surface(self, X, Y, Z, *args, cmap=None, norm=None, vmin=None,
16711671
color = np.array(mcolors.to_rgba(color))
16721672
fcolors = None
16731673

1674+
cmap = kwargs.get('cmap', None)
16741675
shade = kwargs.pop('shade', cmap is None)
16751676

16761677
# Shade the data
@@ -1726,7 +1727,7 @@ def plot_surface(self, X, Y, Z, *args, cmap=None, norm=None, vmin=None,
17261727
else :
17271728
normals = []
17281729

1729-
polyc = art3d.Poly3DCollection(polys, *args, cmap=cmap, **kwargs)
1730+
polyc = art3d.Poly3DCollection(polys, *args, **kwargs)
17301731

17311732
if fcolors is not None:
17321733
if shade:
@@ -1917,9 +1918,8 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
19171918

19181919
return linec
19191920

1920-
def plot_trisurf(self, *args, color=None, cmap=None, norm=None, vmin=None,
1921-
vmax=None, linewidth=None, shade=None, lightsource=None,
1922-
**kwargs):
1921+
def plot_trisurf(self, *args, color=None, norm=None, vmin=None, vmax=None,
1922+
lightsource=None, **kwargs):
19231923
"""
19241924
============= ================================================
19251925
Argument Description
@@ -1975,11 +1975,10 @@ def plot_trisurf(self, *args, color=None, cmap=None, norm=None, vmin=None,
19751975
color = self._get_lines.get_next_color()
19761976
color = np.array(mcolors.to_rgba(color))
19771977

1978-
if shade is None:
1979-
shade = cmap is None
1978+
cmap = kwargs.get('cmap', None)
1979+
shade = kwargs.pop('shade', cmap is None)
19801980

1981-
tri, args, kwargs = Triangulation.get_from_args_and_kwargs(
1982-
*args, cmap=cmap, **kwargs)
1981+
tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs)
19831982
if 'Z' in kwargs:
19841983
z = np.asarray(kwargs.pop('Z'))
19851984
else:

0 commit comments

Comments
 (0)