Discussion:
[Matplotlib-users] surface without lines + circular domain
Diego Avesani
2015-02-16 14:45:47 UTC
Permalink
Dear all,
I have two problems.

1) I would like to plot a 3D surface, but without lines.

2) I would like to plot the surface on a circular domain.

I mean, this is a piece of my code

X = np.arange(0, 1, 0.05)

Y = np.arange(0, 1, 0.05)

X, Y = np.meshgrid(X, Y)

R = np.sqrt(X**2 + Y**2)

Z = np.sin(R)

ax.plot_surface(X, Y, Z, rstride=10, cstride=10, alpha=0.3)


The domain is therefore a square, I would like to have a circular domain.


Thanks a lot




Diego
Raymond Smith
2015-02-16 15:27:01 UTC
Permalink
Hi, Diego

1) use the linewidth=0 kwarg to plot_surface (e.g. see
http://matplotlib.org/examples/mplot3d/surface3d_demo.html)
2) Define your mesh by r, theta, then convert to x, y (e.g. see
http://stackoverflow.com/a/26876699/2965572)

Ray
Post by Diego Avesani
Dear all,
I have two problems.
1) I would like to plot a 3D surface, but without lines.
2) I would like to plot the surface on a circular domain.
I mean, this is a piece of my code
X = np.arange(0, 1, 0.05)
Y = np.arange(0, 1, 0.05)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
ax.plot_surface(X, Y, Z, rstride=10, cstride=10, alpha=0.3)
The domain is therefore a square, I would like to have a circular domain.
Thanks a lot
Diego
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Continue reading on narkive:
Loading...