Ask Your Question
1

load data file to draw surface

asked 2014-10-23 10:56:20 +0200

Avijit gravatar image

updated 2014-10-27 18:48:42 +0200

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

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-10-27 18:47:55 +0200

vdelecroix gravatar image

updated 2014-10-27 18:51:46 +0200

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

edit flag offensive delete link more

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 ( 2019-04-07 21:00:20 +0200 )edit

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: 2014-10-23 10:56:20 +0200

Seen: 8,931 times

Last updated: Oct 27 '14