Ask Your Question
1

How to save graphics into an image in sagemath online?

asked 2014-10-10 18:32:32 -0500

Jorge gravatar image

updated 2015-01-17 10:49:21 -0500

FrédéricC gravatar image

I am running sage cloud with a windows computer and I want to save graphics into an image. I found the following documentation:

sage: c = circle((1,1), 1, color='red')
sage: filename = os.path.join(SAGE_TMP, 'test.png')
sage: c.save(filename, xmin=-1, xmax=3, ymin=-1, ymax=3)

However it save nothing on my system or on the online folder. I suspect that this works when you have sagemath installed on the computer. How can I save on my system or on the online folder?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2014-10-10 19:21:04 -0500

dazedANDconfused gravatar image

updated 2014-10-10 19:28:11 -0500

In SageMath Cloud select "New". Type the name you want and click on "Sage Worksheet". The Sage worksheet opens up. Copy/paste the following code into your worksheet.

c = circle((1,1), 1, color='red')
c.save('test.png', xmin=-1, xmax=3, ymin=-1, ymax=3)

Click on "Save" and then click on "Run". It looks like nothing has really happened but if you click on "Files" you will see test.pgn.

If you click on the name of the picture (test.pgn) it will open in your browser. You can right click on the image and save it to your computer. Another option (instead of clicking on the picture name) is to click on the rectangle furthest left (on the same line as test.pgn) then a box opens up giving you options such as download, move,trash. Press download and it should go to your computer. If not there's a link to click, in which case you download as mentioned above (through right-click and Save as).

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

1 follower

Stats

Asked: 2014-10-10 18:32:32 -0500

Seen: 1,019 times

Last updated: Oct 10 '14