cloud icon indicating copy to clipboard operation
cloud copied to clipboard

Change sagews2pdf.py to layout plots better

Open williamstein opened this issue 11 years ago • 1 comments

From Jeff Denny:


for b in [1,2,3]:
    plot(x^2+b,(x,-2,2))

the PDF shows them side-by-side and so the plots do not print well.

However, adding a single print statement

for b in [1,2,3]:
    plot(x^2+b,(x,-2,2))
    print " "

resolves the issue.

Can the PDF generation be modified to identify when there are multiple plots in one cell and then insert some lines between them so that the latex does not put the plots side-by-side in the PDF?

williamstein avatar Feb 20 '14 07:02 williamstein

Ok, I've taken a stab at this. This is my first attempt at modifying code within Sage or SMC, so please let me know if I need to do things differently.

I changed line #224 in sagews2pdf.py to the following:

s += '\includegraphics[width=\textwidth]{%s} \n\n'%img

This appears to resolve the issue.

jkdenny avatar Feb 20 '14 19:02 jkdenny