@@ -1570,8 +1570,8 @@ def plot_surface(self, X, Y, Z, *args, **kwargs):
1570
1570
1571
1571
The *rcount* and *ccount* kwargs, which both default to 50,
1572
1572
determine the maximum number of samples used in each direction. If
1573
- the input data is larger, it will be downsampled to these numbers
1574
- of points.
1573
+ the input data is larger, it will be downsampled (by slicing) to
1574
+ these numbers of points.
1575
1575
1576
1576
Parameters
1577
1577
----------
@@ -1580,8 +1580,8 @@ def plot_surface(self, X, Y, Z, *args, **kwargs):
1580
1580
1581
1581
rcount, ccount : int
1582
1582
Maximum number of samples used in each direction. If the input
1583
- data is larger, it will be downsampled to these numbers of points.
1584
- Defaults to 50.
1583
+ data is larger, it will be downsampled (by slicing) to these
1584
+ numbers of points. Defaults to 50.
1585
1585
1586
1586
rstride, cstride : int
1587
1587
Downsampling stride in each direction. These arguments are
@@ -1637,14 +1637,14 @@ def plot_surface(self, X, Y, Z, *args, **kwargs):
1637
1637
# So, only compute strides from counts
1638
1638
# if counts were explicitly given
1639
1639
if has_count :
1640
- rstride = int (np .ceil (rows / rcount ))
1641
- cstride = int (np .ceil (cols / ccount ))
1640
+ rstride = int (max ( np .ceil (rows / rcount ), 1 ))
1641
+ cstride = int (max ( np .ceil (cols / ccount ), 1 ))
1642
1642
else :
1643
1643
# If the strides are provided then it has priority.
1644
1644
# Otherwise, compute the strides from the counts.
1645
1645
if not has_stride :
1646
- rstride = int (np .ceil (rows / rcount ))
1647
- cstride = int (np .ceil (cols / ccount ))
1646
+ rstride = int (max ( np .ceil (rows / rcount ), 1 ))
1647
+ cstride = int (max ( np .ceil (cols / ccount ), 1 ))
1648
1648
1649
1649
if 'facecolors' in kwargs :
1650
1650
fcolors = kwargs .pop ('facecolors' )
@@ -1795,8 +1795,8 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
1795
1795
1796
1796
The *rcount* and *ccount* kwargs, which both default to 50,
1797
1797
determine the maximum number of samples used in each direction. If
1798
- the input data is larger, it will be downsampled to these numbers
1799
- of points.
1798
+ the input data is larger, it will be downsampled (by slicing) to
1799
+ these numbers of points.
1800
1800
1801
1801
Parameters
1802
1802
----------
@@ -1805,10 +1805,10 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
1805
1805
1806
1806
rcount, ccount : int
1807
1807
Maximum number of samples used in each direction. If the input
1808
- data is larger, it will be downsampled to these numbers of points.
1809
- Setting a count to zero causes the data to be not sampled in the
1810
- corresponding direction, producing a 3D line plot rather than a
1811
- wireframe plot. Defaults to 50.
1808
+ data is larger, it will be downsampled (by slicing) to these
1809
+ numbers of points. Setting a count to zero causes the data to be
1810
+ not sampled in the corresponding direction, producing a 3D line
1811
+ plot rather than a wireframe plot. Defaults to 50.
1812
1812
1813
1813
rstride, cstride : int
1814
1814
Downsampling stride in each direction. These arguments are
@@ -1848,14 +1848,14 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
1848
1848
# So, only compute strides from counts
1849
1849
# if counts were explicitly given
1850
1850
if has_count :
1851
- rstride = int (np .ceil (rows / rcount )) if rcount else 0
1852
- cstride = int (np .ceil (cols / ccount )) if ccount else 0
1851
+ rstride = int (max ( np .ceil (rows / rcount ), 1 )) if rcount else 0
1852
+ cstride = int (max ( np .ceil (cols / ccount ), 1 )) if ccount else 0
1853
1853
else :
1854
1854
# If the strides are provided then it has priority.
1855
1855
# Otherwise, compute the strides from the counts.
1856
1856
if not has_stride :
1857
- rstride = int (np .ceil (rows / rcount )) if rcount else 0
1858
- cstride = int (np .ceil (cols / ccount )) if ccount else 0
1857
+ rstride = int (max ( np .ceil (rows / rcount ), 1 )) if rcount else 0
1858
+ cstride = int (max ( np .ceil (cols / ccount ), 1 )) if ccount else 0
1859
1859
1860
1860
# We want two sets of lines, one running along the "rows" of
1861
1861
# Z and another set of lines running along the "columns" of Z.
0 commit comments