# 3-D Smooth Surface Plots I want to plot a smooth 3D surface plot using a matrix of integer numbers. Presently my 3d plot consist of 12X12 matrix but the plot output is jagged and less appealing. Therefore I would like to smoothen the plot using interpolation/extrapolation or cubic splines method or any other method so that I get a smooth surface plot

Which functions in SAGE can be used for smoothening the surface plots?

edit retag close merge delete

Sort by » oldest newest most voted The function list_plot3d() has options to do that. To learn about this, look at the documentation by typing:

sage: list_plot3d?


and search for "OPTIONAL KEYWORDS:" and " EXAMPLES:".

For example, you can do:

sage: list_plot3d(M, interpolation_type='spline', degree=3)

more

WorksForMe(TM) in Sagecell and in Sage 9.6.rc3. Let's assess the density of a bivariate standard normal by plotting 1000 random points :

set_random_seed(0)
X=r.rnorm(1000,0,1)._sage_()
Y=r.rnorm(1000,0,1)._sage_()
Z=r.dnorm(list(map(lambda u,v:sqrt(u^2+v^2), X, Y)),0,1)._sage_()
P=list_plot3d(list(zip(X,Y,Z)))
show(P, aspect_ratio=[1,1,5])


See fpr yourself !

HTH,

more