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().
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.
So my question is how can I plot my data!? Is there away of using
plot3d 'outside' of Sage? I noticed that it is some how making a call
to JMol (or PyMol), would you know how I could do this?
Regards,
Daniel
#
# Error message
#
Warning: No more knots can be added because the number of B-spline
coefficients
already exceeds the number of data points m. Probably causes:
either
s or m too small. (fp>s)
kx,ky=1,1 nx,ny=21,21 m=360 fp=0.000426 s=0.000000
--
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