On Sun, Nov 14, 2010 at 11:24 AM, Eugene Goldberg <[email protected]> wrote:
> Hi!
>
> I want to save my plot using notebook:
>
> plot(sin,0,4).save('foo.png')
>
> this code saves my plot, but also calls show method (or something like
> that) and I have plot in output. Is it possible only to save plot,
> without any output at all?

Yes, in several ways..

1. You could do:

   plot(sin, 0, 4).save('/tmp/foo.png')

2.

   plot(sin, 0, 4).save(DATA+ '/foo.png')

If you do the latter, then press refresh to totally refresh your page,
then click "Data... " on the top of the worksheet, you'll see your
image is there.

3.  In general, any time you output any images using any command at
all in the notebook, the resulting image will just appear displayed in
the output.  There is one way around this, which is to generate html
with a reference to cell://foo.png, which causes the notebook to not
display the image.

plot(sin, 0, 4).save('foo.png')
html('<img src="cell://foo.png" width=0> <a href="foo.png">foo.png</a> ')

Above I had to put an explicit <a href> or you get no link to the image either.

 -- William

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to