Ask Your Question
1

plot.save different image than plot.show?

asked 2010-11-27 15:39:02 +0100

Ciantic gravatar image

updated 2010-11-27 15:48:18 +0100

Hi!

I've been wondering why on earth plot.save() and plot.show() uses different settings:

p = plot(x^2+100, x, frame=True, gridlines=True)
p.show()
p.save('mydrawing2.pdf')

It draws the image with frames and gridlines, but the PDF is missing those. Is there a good reason why it does not use the same drawing settings for saving? If I wanted to use save() I have to retype the frame=True, gridlines=True, ... to the save().

I've nonetheless found a workaround:

p = plot(x^2+100, x, frame=True, gridlines=True)
p.show()
p.show(filename='mydrawing2.pdf')

It shows dead image in browser (since PDF can't be shown with img tag), but it actually is PDF file if I choose to save it, and this time around it has the same drawing settings.

But to me, it would be helpful if the plot.save() were use the same settings, using dictionary and **kwargs passing is very ugly looking.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2010-11-27 17:07:23 +0100

Mike Hansen gravatar image

This is bug #7981, and it will hopefully be fixed in an upcoming version of Sage. If you need it fixed now, you can apply the second patch on that ticket. Use the steps 1 - 4 here if you aren't sure how to apply the patch.

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

Stats

Asked: 2010-11-27 15:39:02 +0100

Seen: 628 times

Last updated: Nov 27 '10