Ask Your Question
1

load data file to draw surface

asked 10 years ago

Avijit gravatar image

updated 10 years ago

vdelecroix gravatar image

I have a matrix consisting of 512 rows and 512 columns. I have written this matrix down into a text file. Each cell of the matrix contains a positive value. I want to plot these values in 3 dimensional system to form a surface by uploading the text file. How to do it in sage ?

Thank you

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 10 years ago

vdelecroix gravatar image

updated 10 years ago

Hello,

First you have to load the matrix into sage. It really depends on how did you save the values. To open a file you use the function open from Python.

Secondly, given a matrix, I am not sure there is a ready made solution inside Sage. But you might use point3d. I would think that the best solution is to use directly matplotlib (which is what Sage uses in background). You can have a look at these matplotlib examples.

Vincent

Preview: (hide)
link

Comments

There is something ready to use

sage: m = matrix(QQ,10,10,lambda i,j : i**2+j**2)
sage: list_plot3d(m)
FrédéricC gravatar imageFrédéricC ( 6 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 9,047 times

Last updated: Oct 27 '14