ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 21 Sep 2016 06:29:56 -0500How to include PDF image from Sage into LaTeX document (scale issue)?https://ask.sagemath.org/question/34877/how-to-include-pdf-image-from-sage-into-latex-document-scale-issue/Hello!
I have a PDF illustration prepared in Sage:
p = plot(sin, 0, pi, fontsize=12, axes_labels=('ABCDE', ur'$ABCDE$'))
p.save('/tmp/sage1.pdf')
And the following LaTeX document:
\documentclass[12pt]{article}
\usepackage{graphicx}
\graphicspath{{/}}
\begin{document}
ABCDE $ABCDE$ \\
\includegraphics{sage1.pdf}
\end{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](/upfiles/14744573018217295.png)EugeneWed, 21 Sep 2016 06:29:56 -0500https://ask.sagemath.org/question/34877/How can I determine or control a plot's display scale?https://ask.sagemath.org/question/10722/how-can-i-determine-or-control-a-plots-display-scale/Suppose I do something like
p = plot(sin(x), (x,0,2*pi))
p.save("/tmp/plot.png")
Is there some way of knowing (or even better, controlling) *exactly* the scale of the saved image in pixels per axis unit (in each direction)?
For example, if I wish to write a second graph to a different png file at exactly the same scale, is there some way to do this?
Or, to put it differently, instead of specifying the size of the output png file in inches using `figsize`, I wish to specify the size in inches (or pixels) *per graph unit*.
[This matplotlib tutorial](http://matplotlib.org/users/transforms_tutorial.html) seems to be about what interests me, but I don't understand how Sage relates to matplotlib, and how I can access the `transData` field, let alone control its value.Gro-TsenSun, 10 Nov 2013 12:19:13 -0600https://ask.sagemath.org/question/10722/