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

Skip to content

Commit 5a00e0d

Browse files
committed
Use np.hypot whereever possible.
Except examples, where it may be too obscure? Also added -T to CI sphinx-build invocation, to help troubleshooting e.g. https://circleci.com/gh/anntzer/matplotlib/2505?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link (show traceback on sphinx failure).
1 parent fb4b612 commit 5a00e0d

23 files changed

+68
-82
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mpl-run: &mpl-install
6868

6969
doc-run: &doc-build
7070
name: Build documentation
71-
command: make html
71+
command: make html O=-T
7272
working_directory: doc
7373

7474
doc-bundle-run: &doc-bundle

examples/event_handling/pick_event_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def line_picker(line, mouseevent):
122122
xdata = line.get_xdata()
123123
ydata = line.get_ydata()
124124
maxd = 0.05
125-
d = np.sqrt((xdata - mouseevent.xdata)**2. + (ydata - mouseevent.ydata)**2.)
125+
d = np.sqrt(
126+
(xdata - mouseevent.xdata)**2 + (ydata - mouseevent.ydata)**2)
126127

127128
ind = np.nonzero(np.less_equal(d, maxd))
128129
if len(ind):

examples/images_contours_and_fields/barb_demo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828

2929
# Arbitrary set of vectors, make them longer and change the pivot point
3030
# (point around which they're rotated) to be the middle
31-
axs1[0, 1].barbs(data['x'], data['y'], data['u'], data['v'], length=8, pivot='middle')
31+
axs1[0, 1].barbs(
32+
data['x'], data['y'], data['u'], data['v'], length=8, pivot='middle')
3233

3334
# Showing colormapping with uniform grid. Fill the circle for an empty barb,
3435
# don't round the values, and change some of the size parameters
35-
axs1[1, 0].barbs(X, Y, U, V, np.sqrt(U * U + V * V), fill_empty=True, rounding=False,
36-
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3))
36+
axs1[1, 0].barbs(
37+
X, Y, U, V, np.sqrt(U ** 2 + V ** 2), fill_empty=True, rounding=False,
38+
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3))
3739

3840
# Change colors as well as the increments for parts of the barbs
3941
axs1[1, 1].barbs(data['x'], data['y'], data['u'], data['v'], flagcolor='r',

examples/images_contours_and_fields/contourf_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
Z[:nr // 6, :nc // 6] = np.ma.masked
3131

3232
# mask a circle in the middle:
33-
interior = np.sqrt((X**2) + (Y**2)) < 0.5
33+
interior = np.sqrt(X**2 + Y**2) < 0.5
3434
Z[interior] = np.ma.masked
3535

3636
# We are using automatic selection of contour levels;

examples/images_contours_and_fields/plot_streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
2121
U = -1 - X**2 + Y
2222
V = 1 + X - Y**2
23-
speed = np.sqrt(U*U + V*V)
23+
speed = np.sqrt(U**2 + V**2)
2424

2525
fig = plt.figure(figsize=(7, 9))
2626
gs = gridspec.GridSpec(nrows=3, ncols=2, height_ratios=[1, 1, 2])

examples/lines_bars_and_markers/scatter_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
y = 0.9 * np.random.rand(N)
2121
area = np.pi * (10 * np.random.rand(N))**2 # 0 to 10 point radii
2222
c = np.sqrt(area)
23-
r = np.sqrt(x * x + y * y)
23+
r = np.sqrt(x ** 2 + y ** 2)
2424
area1 = np.ma.masked_where(r < r0, area)
2525
area2 = np.ma.masked_where(r >= r0, area)
2626
plt.scatter(x, y, s=area1, marker='^', c=c)

lib/matplotlib/contour.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,9 @@ def print_label(self, linecontour, labelwidth):
232232

233233
def too_close(self, x, y, lw):
234234
"Return *True* if a label is already near this location."
235-
for loc in self.labelXYs:
236-
d = np.sqrt((x - loc[0]) ** 2 + (y - loc[1]) ** 2)
237-
if d < 1.2 * lw:
238-
return True
239-
return False
235+
thresh = (1.2 * lw) ** 2
236+
return any((x - loc[0]) ** 2 + (y - loc[1]) ** 2 < thresh
237+
for loc in self.labelXYs)
240238

241239
def get_label_coords(self, distances, XX, YY, ysize, lw):
242240
"""

lib/matplotlib/lines.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,16 @@ def contains(self, mouseevent):
481481
else:
482482
pixels = self.figure.dpi / 72. * self.pickradius
483483

484-
# the math involved in checking for containment (here and inside of
485-
# segment_hits) assumes that it is OK to overflow. In case the
486-
# application has set the error flags such that an exception is raised
487-
# on overflow, we temporarily set the appropriate error flags here and
488-
# set them back when we are finished.
484+
# The math involved in checking for containment (here and inside of
485+
# segment_hits) assumes that it is OK to overflow, so temporarily set
486+
# the error flags accordingly.
489487
with np.errstate(all='ignore'):
490488
# Check for collision
491489
if self._linestyle in ['None', None]:
492490
# If no line, return the nearby point(s)
493-
d = (xt - mouseevent.x) ** 2 + (yt - mouseevent.y) ** 2
494-
ind, = np.nonzero(np.less_equal(d, pixels ** 2))
491+
ind, = np.nonzero(
492+
(xt - mouseevent.x) ** 2 + (yt - mouseevent.y) ** 2
493+
<= pixels ** 2)
495494
else:
496495
# If line, return the nearby segment(s)
497496
ind = segment_hits(mouseevent.x, mouseevent.y, xt, yt, pixels)

lib/matplotlib/patches.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,10 +1338,8 @@ def get_path(self):
13381338
xb1, yb1, xb2, yb2 = self.getpoints(x1, y1, x2, y2, k1)
13391339

13401340
# a point on the segment 20% of the distance from the tip to the base
1341-
theta = math.atan2(y2 - y1, x2 - x1)
1342-
r = math.sqrt((y2 - y1) ** 2. + (x2 - x1) ** 2.)
1343-
xm = x1 + self.frac * r * math.cos(theta)
1344-
ym = y1 + self.frac * r * math.sin(theta)
1341+
xm = x1 + self.frac * (x2 - x1)
1342+
ym = y1 + self.frac * (y2 - y1)
13451343
xc1, yc1, xc2, yc2 = self.getpoints(x1, y1, xm, ym, k1)
13461344
xd1, yd1, xd2, yd2 = self.getpoints(x1, y1, xm, ym, k2)
13471345

@@ -2899,10 +2897,10 @@ def connect(self, posA, posB):
28992897
codes.append(Path.LINETO)
29002898
else:
29012899
dx1, dy1 = x1 - cx, y1 - cy
2902-
d1 = (dx1 ** 2 + dy1 ** 2) ** .5
2900+
d1 = np.hypot(dx1, dy1)
29032901
f1 = self.rad / d1
29042902
dx2, dy2 = x2 - cx, y2 - cy
2905-
d2 = (dx2 ** 2 + dy2 ** 2) ** .5
2903+
d2 = np.hypot(dx2, dy2)
29062904
f2 = self.rad / d2
29072905
vertices.extend([(cx + dx1 * f1, cy + dy1 * f1),
29082906
(cx, cy),
@@ -3295,7 +3293,7 @@ def transmute(self, path, mutation_size, linewidth):
32953293

32963294
head_length = self.head_length * mutation_size
32973295
head_width = self.head_width * mutation_size
3298-
head_dist = math.sqrt(head_length ** 2 + head_width ** 2)
3296+
head_dist = np.hypot(head_length, head_width)
32993297
cos_t, sin_t = head_length / head_dist, head_width / head_dist
33003298

33013299
# begin arrow

lib/matplotlib/projections/geo.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,12 @@ def transform_non_affine(self, ll):
465465
diff_long = longitude - clong
466466
cos_diff_long = np.cos(diff_long)
467467

468-
inner_k = (1.0 +
469-
np.sin(clat)*sin_lat +
470-
np.cos(clat)*cos_lat*cos_diff_long)
471-
# Prevent divide-by-zero problems
472-
inner_k = np.where(inner_k == 0.0, 1e-15, inner_k)
473-
k = np.sqrt(2.0 / inner_k)
474-
x = k*cos_lat*np.sin(diff_long)
475-
y = k*(np.cos(clat)*sin_lat -
476-
np.sin(clat)*cos_lat*cos_diff_long)
468+
inner_k = np.max( # Prevent divide-by-zero problems
469+
1 + np.sin(clat)*sin_lat + np.cos(clat)*cos_lat*cos_diff_long,
470+
1e-15)
471+
k = np.sqrt(2 / inner_k)
472+
x = k * cos_lat*np.sin(diff_long)
473+
y = k * (np.cos(clat)*sin_lat - np.sin(clat)*cos_lat*cos_diff_long)
477474

478475
return np.concatenate((x, y), 1)
479476
transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__
@@ -497,8 +494,7 @@ def transform_non_affine(self, xy):
497494
y = xy[:, 1:2]
498495
clong = self._center_longitude
499496
clat = self._center_latitude
500-
p = np.sqrt(x*x + y*y)
501-
p = np.where(p == 0.0, 1e-9, p)
497+
p = np.max(np.hypot(x, y), 1e-9)
502498
c = 2.0 * np.arcsin(0.5 * p)
503499
sin_c = np.sin(c)
504500
cos_c = np.cos(c)

lib/matplotlib/projections/polar.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,8 @@ def __str__(self):
151151
def transform_non_affine(self, xy):
152152
x = xy[:, 0:1]
153153
y = xy[:, 1:]
154-
r = np.sqrt(x*x + y*y)
155-
with np.errstate(invalid='ignore'):
156-
# At x=y=r=0 this will raise an
157-
# invalid value warning when doing 0/0
158-
# Divide by zero warnings are only raised when
159-
# the numerator is different from 0. That
160-
# should not happen here.
161-
theta = np.arccos(x / r)
162-
theta = np.where(y < 0, 2 * np.pi - theta, theta)
154+
r = np.hypot(x, y)
155+
theta = (np.arctan2(y, x) + 2 * np.pi) % (2 * np.pi)
163156

164157
# PolarAxes does not use the theta transforms here, but apply them for
165158
# backwards-compatibility if not being used by it.

lib/matplotlib/streamplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
190190
streamlines.extend(np.hstack([points[:-1], points[1:]]))
191191

192192
# Add arrows half way along each trajectory.
193-
s = np.cumsum(np.sqrt(np.diff(tx) ** 2 + np.diff(ty) ** 2))
193+
s = np.cumsum(np.hypot(np.diff(tx), np.diff(ty)))
194194
n = np.searchsorted(s, s[-1] / 2.)
195195
arrow_tail = (tx[n], ty[n])
196196
arrow_head = (np.mean(tx[n:n + 2]), np.mean(ty[n:n + 2]))
@@ -416,7 +416,7 @@ def get_integrator(u, v, dmap, minlength, maxlength, integration_direction):
416416
# speed (path length) will be in axes-coordinates
417417
u_ax = u / dmap.grid.nx
418418
v_ax = v / dmap.grid.ny
419-
speed = np.ma.sqrt(u_ax ** 2 + v_ax ** 2)
419+
speed = np.ma.hypot(u_ax, v_ax)
420420

421421
def forward_time(xi, yi):
422422
ds_dt = interpgrid(speed, xi, yi)
@@ -539,7 +539,7 @@ def _integrate_rk12(x0, y0, dmap, f, maxlength):
539539

540540
nx, ny = dmap.grid.shape
541541
# Error is normalized to the axes coordinates
542-
error = np.sqrt(((dx2 - dx1) / nx) ** 2 + ((dy2 - dy1) / ny) ** 2)
542+
error = np.hypot((dx2 - dx1) / nx, (dy2 - dy1) / ny)
543543

544544
# Only save step if within error tolerance
545545
if error < maxerror:

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def test_pcolorargs():
11831183
x = np.linspace(-1.5, 1.5, n)
11841184
y = np.linspace(-1.5, 1.5, n*2)
11851185
X, Y = np.meshgrid(x, y)
1186-
Z = np.sqrt(X**2 + Y**2)/5
1186+
Z = np.hypot(X, Y) / 5
11871187

11881188
_, ax = plt.subplots()
11891189
with pytest.raises(TypeError):

lib/matplotlib/tests/test_contour.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def test_corner_mask():
291291
np.random.seed([1])
292292
x, y = np.meshgrid(np.linspace(0, 2.0, n), np.linspace(0, 2.0, n))
293293
z = np.cos(7*x)*np.sin(8*y) + noise_amp*np.random.rand(n, n)
294-
mask = np.where(np.random.rand(n, n) >= mask_level, True, False)
294+
mask = np.random.rand(n, n) >= mask_level
295295
z = np.ma.array(z, mask=mask)
296296

297297
for corner_mask in [False, True]:
@@ -362,7 +362,7 @@ def test_circular_contour_warning():
362362
# Check that almost circular contours don't throw a warning
363363
with pytest.warns(None) as record:
364364
x, y = np.meshgrid(np.linspace(-2, 2, 4), np.linspace(-2, 2, 4))
365-
r = np.sqrt(x ** 2 + y ** 2)
365+
r = np.hypot(x, y)
366366

367367
plt.figure()
368368
cs = plt.contour(x, y, r)

lib/matplotlib/tests/test_image.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,11 @@ def test_mask_image():
769769
def test_imshow_endianess():
770770
x = np.arange(10)
771771
X, Y = np.meshgrid(x, x)
772-
Z = ((X-5)**2 + (Y-5)**2)**0.5
772+
Z = np.hypot(X - 5, Y - 5)
773773

774774
fig, (ax1, ax2) = plt.subplots(1, 2)
775775

776-
kwargs = dict(origin="lower", interpolation='nearest',
777-
cmap='viridis')
776+
kwargs = dict(origin="lower", interpolation='nearest', cmap='viridis')
778777

779778
ax1.imshow(Z.astype('<f8'), **kwargs)
780779
ax2.imshow(Z.astype('>f8'), **kwargs)

lib/matplotlib/tests/test_quiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_barbs():
137137
X, Y = np.meshgrid(x, x)
138138
U, V = 12*X, 12*Y
139139
fig, ax = plt.subplots()
140-
ax.barbs(X, Y, U, V, np.sqrt(U*U + V*V), fill_empty=True, rounding=False,
140+
ax.barbs(X, Y, U, V, np.hypot(U, V), fill_empty=True, rounding=False,
141141
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3),
142142
cmap='viridis')
143143

lib/matplotlib/tests/test_streamplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def test_colormap():
5151
@image_comparison(baseline_images=['streamplot_linewidth'])
5252
def test_linewidth():
5353
X, Y, U, V = velocity_field()
54-
speed = np.sqrt(U*U + V*V)
55-
lw = 5*speed/speed.max()
56-
df = 25. / 30. # Compatibility factor for old test image
54+
speed = np.hypot(U, V)
55+
lw = 5 * speed / speed.max()
56+
df = 25 / 30 # Compatibility factor for old test image
5757
plt.streamplot(X, Y, U, V, density=[0.5 * df, 1. * df], color='k',
5858
linewidth=lw)
5959

lib/matplotlib/tests/test_triangulation.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,10 @@ def test_triinterp_transformations():
664664
min_radius = 0.15
665665

666666
def z(x, y):
667-
r1 = np.sqrt((0.5-x)**2 + (0.5-y)**2)
668-
theta1 = np.arctan2(0.5-x, 0.5-y)
669-
r2 = np.sqrt((-x-0.2)**2 + (-y-0.2)**2)
670-
theta2 = np.arctan2(-x-0.2, -y-0.2)
667+
r1 = np.hypot(0.5 - x, 0.5 - y)
668+
theta1 = np.arctan2(0.5 - x, 0.5 - y)
669+
r2 = np.hypot(-x - 0.2, -y - 0.2)
670+
theta2 = np.arctan2(-x - 0.2, -y - 0.2)
671671
z = -(2*(np.exp((r1/10)**2)-1)*30. * np.cos(7.*theta1) +
672672
(np.exp((r2/10)**2)-1)*30. * np.cos(11.*theta2) +
673673
0.7*(x**2 + y**2))
@@ -752,10 +752,10 @@ def test_tri_smooth_contouring():
752752
min_radius = 0.15
753753

754754
def z(x, y):
755-
r1 = np.sqrt((0.5-x)**2 + (0.5-y)**2)
756-
theta1 = np.arctan2(0.5-x, 0.5-y)
757-
r2 = np.sqrt((-x-0.2)**2 + (-y-0.2)**2)
758-
theta2 = np.arctan2(-x-0.2, -y-0.2)
755+
r1 = np.hypot(0.5 - x, 0.5 - y)
756+
theta1 = np.arctan2(0.5 - x, 0.5 - y)
757+
r2 = np.hypot(-x - 0.2, -y - 0.2)
758+
theta2 = np.arctan2(-x - 0.2, -y - 0.2)
759759
z = -(2*(np.exp((r1/10)**2)-1)*30. * np.cos(7.*theta1) +
760760
(np.exp((r2/10)**2)-1)*30. * np.cos(11.*theta2) +
761761
0.7*(x**2 + y**2))
@@ -817,8 +817,8 @@ def dipole_potential(x, y):
817817

818818
# Computes the electrical field (Ex, Ey) as gradient of -V
819819
tci = mtri.CubicTriInterpolator(triang, -V)
820-
(Ex, Ey) = tci.gradient(triang.x, triang.y)
821-
E_norm = np.sqrt(Ex**2 + Ey**2)
820+
Ex, Ey = tci.gradient(triang.x, triang.y)
821+
E_norm = np.hypot(Ex, Ey)
822822

823823
# Plot the triangulation, the potential iso-contours and the vector field
824824
plt.figure()
@@ -938,7 +938,7 @@ def test_trirefine():
938938
y = np.asarray([0.0, 0.0, 1.0, 1.0])
939939
triang = [mtri.Triangulation(x, y, [[0, 1, 3], [3, 2, 0]]),
940940
mtri.Triangulation(x, y, [[0, 1, 3], [2, 0, 3]])]
941-
z = np.sqrt((x-0.3)*(x-0.3) + (y-0.4)*(y-0.4))
941+
z = np.hypot(x - 0.3, y - 0.4)
942942
# Refining the 2 triangulations and reordering the points
943943
xyz_data = []
944944
for i in range(2):

lib/matplotlib/tri/tritools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def circle_ratios(self, rescale=True):
9292
a = tri_pts[:, 1, :] - tri_pts[:, 0, :]
9393
b = tri_pts[:, 2, :] - tri_pts[:, 1, :]
9494
c = tri_pts[:, 0, :] - tri_pts[:, 2, :]
95-
a = np.sqrt(a[:, 0]**2 + a[:, 1]**2)
96-
b = np.sqrt(b[:, 0]**2 + b[:, 1]**2)
97-
c = np.sqrt(c[:, 0]**2 + c[:, 1]**2)
95+
a = np.hypot(a[:, 0], a[:, 1])
96+
b = np.hypot(b[:, 0], b[:, 1])
97+
c = np.hypot(c[:, 0], c[:, 1])
9898
# circumcircle and incircle radii
9999
s = (a+b+c)*0.5
100100
prod = s*(a+b-s)*(a+c-s)*(b+c-s)

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2676,7 +2676,7 @@ def _onmove(self, event):
26762676
# Calculate distance to the start vertex.
26772677
x0, y0 = self.line.get_transform().transform((self._xs[0],
26782678
self._ys[0]))
2679-
v0_dist = np.sqrt((x0 - event.x) ** 2 + (y0 - event.y) ** 2)
2679+
v0_dist = np.hypot(x0 - event.x, y0 - event.y)
26802680
# Lock on to the start vertex if near it and ready to complete.
26812681
if len(self._xs) > 3 and v0_dist < self.vertex_select_radius:
26822682
self._xs[-1], self._ys[-1] = self._xs[0], self._ys[0]

lib/mpl_toolkits/mplot3d/proj3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def line2d_dist(l, p):
4343
"""
4444
a, b, c = l
4545
x0, y0 = p
46-
return abs((a*x0 + b*y0 + c)/np.sqrt(a**2+b**2))
46+
return abs((a*x0 + b*y0 + c) / np.hypot(a, b))
4747

4848

4949
def line2d_seg_dist(p1, p2, p0):
@@ -63,7 +63,7 @@ def line2d_seg_dist(p1, p2, p0):
6363

6464
u = (x01*x21 + y01*y21) / (x21**2 + y21**2)
6565
u = np.clip(u, 0, 1)
66-
d = np.sqrt((x01 - u*x21)**2 + (y01 - u*y21)**2)
66+
d = np.hypot(x01 - u*x21, y01 - u*y21)
6767

6868
return d
6969

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def f(t):
145145

146146
ax = fig.add_subplot(2, 1, 2, projection='3d')
147147
X, Y = np.meshgrid(np.arange(-5, 5, 0.25), np.arange(-5, 5, 0.25))
148-
R = np.sqrt(X ** 2 + Y ** 2)
148+
R = np.hypot(X, Y)
149149
Z = np.sin(R)
150150

151151
surf = ax.plot_surface(X, Y, Z, rcount=40, ccount=40,
@@ -193,7 +193,7 @@ def test_surface3d():
193193
X = np.arange(-5, 5, 0.25)
194194
Y = np.arange(-5, 5, 0.25)
195195
X, Y = np.meshgrid(X, Y)
196-
R = np.sqrt(X ** 2 + Y ** 2)
196+
R = np.hypot(X, Y)
197197
Z = np.sin(R)
198198
surf = ax.plot_surface(X, Y, Z, rcount=40, ccount=40, cmap=cm.coolwarm,
199199
lw=0, antialiased=False)

0 commit comments

Comments
 (0)