Ask Your Question

Ciantic's profile - activity

2014-06-19 21:40:25 +0100 received badge  Notable Question (source)
2012-09-12 06:09:03 +0100 received badge  Popular Question (source)
2010-11-29 15:47:43 +0100 received badge  Student (source)
2010-11-29 15:47:43 +0100 received badge  Editor (source)
2010-11-27 15:39:02 +0100 asked a question plot.save different image than plot.show?

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.