Dear Steven, 
Thanks for your help.
Definitively Plot3D works on: 

fig = plt.figure()
ax = gca(projection="3d")
X = linspace(-5, 5, 300)
Y = linspace(-5, 5, 300)
R = linspace(-2pi, 2pi, 300)
X, Y = (X, Y)
R = sqrt(X.^2 + Y.^2)
Z = sin(R)
surf = plot_surface(X, Y, Z, rstride=1, cstride=1, linewidth=1, 
antialiased=False)
plot3D(X,Y,Z)
plt.show()

<https://lh3.googleusercontent.com/-iKemrHdhloA/VH7mtge6AMI/AAAAAAAAAGU/8WGmpHOa2UU/s1600/Screen%2BShot%2B2014-12-03%2Bat%2B11.26.40%2BAM.png>




Not able to get version surface3d of it as suggested by mplot3d code: 

<https://lh6.googleusercontent.com/-p2tjaDKF4zM/VH7qUhg9OpI/AAAAAAAAAGg/rnPKhmo6D58/s1600/Screen%2BShot%2B2014-12-03%2Bat%2B11.31.25%2BAM.png>


Some translations from python to Julia work ok. But not able to translate 
these: 

X,Y = meshgrid (X,Y) 
and 
fig.colorbar(surf, shrink=0.5, aspect=5)

I'd tried surf(X,Y,Z)  to get the surface3d aspect;  Error: not defined! 
In a second example I was able to use it: 

fig = plt.figure()
ax = gca(projection="3d")
theta = linspace(-4pi, 4pi, 300)
Z = linspace(-2, 2, 300)
R = Z.^2
X =  R .* sin(theta)
Y =  R .* cos(theta)
surf(X, Y, Z)                 <<<<< It works! 
plt.show() 

Welcome yours suggestions on those translations. 
At the end I would suggest to organize a mplot3d examples code translation 
from Python to Julia documentation, but I will need help of community!   
Thanks, G. 
 
On Tuesday, December 2, 2014 2:32:38 AM UTC+1, Steven G. Johnson wrote:
>
> On Monday, December 1, 2014 9:07:10 AM UTC-5, Giacomo Kresak wrote:
>>
>> Do you know if plt.plot is the good way to go? Not able to use plot3d or 
>> plot3D with Julia (PyPlot)! 
>>
>
> Matplotlib's plot3D function is indeed exported by PyPlot.   (You can't 
> access it via plt.plot3D because it is not actually in the 
> matplotlib.pyplot module, it is in mpl_toolkits.mplot3d)  Just call it via, 
> for example:
>
>       θ = linspace(0,6π,300)
>       plot3D(cos(θ), sin(θ), θ)
>
> There are also other 3d plotting functions from Matplotlib, e.g. 
> surf(x,y,z) to do a surface plot.
>

Reply via email to