Daniel Farrell wrote:
> Hi folks,
>
> Plot3d() look amazing! I really like the way lighting is used to
> because it help understand the shape of the surface.
>
> I have a data file that I want to plot using plot3d, so I import the
> data using numpy.loadtxt. plot3d() only plots functions so I try to
> interpolate the dataset using scipy.interpolate.interp2d() and then
> pass the interpolator as a lambda function to plot3d().
Have you tried using list_plot3d? Here is an example from the help
(when you type "list_plot3d?")
sage: n = 5; list_plot3d(matrix(RDF,n,[(i+j)%n for i in [1..n] for j in
[1..n]]))
>
> import numpy as np
> from scipy.interpolate import interp2d
> x = np.loadtxt("x.txt")
> y = np.loadtxt("y.txt")
> z = np.loadtxt("z.txt")
> data_i = interp_surface(x,y,z,kind='linear',copy=False) # Fails here
> with the error below
> plot3d(lambda X,Y: data_i(X,Y), x, y)
>
> Unfortunately, the scipy cannot create the interpolation object even
> though the data is really smooth. I give the error at the bottom of
> this message. Sage is using scipy version 0.7. I have Scipy version
> 0.8.0 installed and the interp2d() call works perfectly! So I guess
> this is a problem with Scipy 0.7.
Apparently we should upgrade to scipy 0.8 as well.
Thanks,
Jason
--
Jason Grout
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org