Ask Your Question

.svg files

asked 2012-07-16 17:52:46 +0200

anonymous user


updated 2015-01-14 14:04:19 +0200

FrédéricC gravatar image

I'm using SAGE remotely and I would like to know how to save .svg files to my computer.

edit retag flag offensive close merge delete


Hmm, strange - I get a hyperlink when I do a plot `P` and do `'fun.pdf')` but not with `'fun.svg')`. I don't expect it with `'fun.png'` but those are easy to just drag and drop. I'd like to know how to do this too!

kcrisman gravatar imagekcrisman ( 2012-07-16 18:13:11 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2012-07-16 23:09:29 +0200

benjaminfjones gravatar image

I don't know why, but SVG files get injected directly into the worksheet HTML, unlike PDF or other filetypes which just get a link. Here is a workaround,

P=plot(sin(x), (x,0,pi))
fn = 'plot.svg', figsize=[2,2])
html(r'<a href="data/'+fn+r'">plot</a>')

It's not very nice, but it does the job. You can now right click on the link and download the SVG file.

edit flag offensive delete link more


Oh, yeah, I should have thought of using `DATA`. Nice!

kcrisman gravatar imagekcrisman ( 2012-07-17 10:40:47 +0200 )edit

By the way, SVG is injected because it is a "native" html thingie, I think, like pngs. See and see the whole list of file types that do different things at I'm not sure exactly what the right long-term fix for this would be.

kcrisman gravatar imagekcrisman ( 2012-07-17 10:46:00 +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


Asked: 2012-07-16 17:52:46 +0200

Seen: 683 times

Last updated: Jul 16 '12