# .svg files

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

.svg files

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

1

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'
P.save(DATA+fn, 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.

By the way, SVG is injected because it is a "native" html thingie, I think, like pngs. See https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/cell.py#L2353 and see the whole list of file types that do different things at https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/cell.py#L2342 I'm not sure exactly what the right long-term fix for this would be.

Asked: **
2012-07-16 10:52:46 -0500
**

Seen: **373 times**

Last updated: **Jul 16 '12**

Graph theory exporting problems

How to save graphics into an image in sagemath online?

How do I install python modules, or use a different version of python? (with sage)

How can I determine or control a plot's display scale?

Sage Math Cloud Plotting Error, ValueError: cannot convert x to int

Plotting x, free variable error

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

Hmm, strange - I get a hyperlink when I do a plot `P` and do `P.save('fun.pdf')` but not with `P.save('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!