First time here? Check out the FAQ!

Ask Your Question
2

3-D Smooth Surface Plots

asked 11 years ago

yMAHESHWARAN gravatar image

updated 10 years ago

FrédéricC gravatar image

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
5

answered 11 years ago

tmonteil gravatar image

updated 5 years ago

FrédéricC gravatar image

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)
Preview: (hide)
link
0

answered 2 years ago

Emmanuel Charpentier gravatar image

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,

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 1,128 times

Last updated: May 13 '22