First time here? Check out the FAQ!

Ask Your Question
1

plot.save different image than plot.show?

asked 14 years ago

Ciantic gravatar image

updated 14 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 14 years ago

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.

Preview: (hide)
link

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: 14 years ago

Seen: 682 times

Last updated: Nov 27 '10