Ask Your Question

How to include PDF image from Sage into LaTeX document (scale issue)?

asked 2016-09-21 13:29:56 +0200

Eugene gravatar image


I have a PDF illustration prepared in Sage:

p = plot(sin, 0, pi, fontsize=12, axes_labels=('ABCDE', ur'$ABCDE$'))'/tmp/sage1.pdf')

And the following LaTeX document:




The problem is that the font size is inconsistent - is is clearly bigger in the picture than in document. I know about width parameter for includegraphics and other scaling option, but how to select the scale? Or, more generally, how to include PDF graphics to get exactly the same font size?

font size issue

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-09-21 23:04:12 +0200

eric_g gravatar image

You have to add axes_labels_size=1 to the arguments of plot:

p = plot(sin, 0, pi, fontsize=12, axes_labels=('ABCDE', ur'$ABCDE$'), axes_labels_size=1)

Indeed, axes_labels_size sets the relative size of the axes labels with respect to fontsize and its default value is 1.6.

edit flag offensive delete link more

answered 2016-09-22 08:52:32 +0200

stan gravatar image

You have two degrees of freedom here, one is to scale the figure directly in latex, e.g. \includegraphics[width=8cm]{sage1.pdf}, or change the font size in the sage document. To do this, you could type p.fontsize(10) or some appropriate number just before Just type p. and press the tab key to see all possible commands that can be passed to your plot. Also, type in the worksheet to find out about other options (e.g. legend_font_size()). Hope this helps.

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

1 follower


Asked: 2016-09-21 13:29:56 +0200

Seen: 1,003 times

Last updated: Sep 22 '16