Ask Your Question
2

3-D Smooth Surface Plots

asked 2013-09-06 06:25:50 +0100

yMAHESHWARAN gravatar image

updated 2015-01-23 21:55:59 +0100

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?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
5

answered 2013-09-06 10:29:34 +0100

tmonteil gravatar image

updated 2019-04-07 21:00:53 +0100

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)
edit flag offensive delete link more
0

answered 2022-05-13 22:49:45 +0100

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,

edit flag offensive delete link more

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: 2013-09-06 06:25:50 +0100

Seen: 1,091 times

Last updated: May 13 '22