pgf

How to avoid calling latex in matplotlib (output to pgf)

六月ゝ 毕业季﹏ 提交于 2020-03-02 03:55:48
问题 I'm using matplotlib with its pgf backend to generate plots that I include in my LaTeX beamer document. I run into trouble when I use latex commands that are not defined. But for my application, I don't need matplotlib to generate the labels or annotations with latex, I only want a correct pgf output and I will call LaTeX on my beamer document. If I would run this code in a notebook, I would expect just to have a plot with a literal "\si{\percent}" in the xlabel. In the MWE below, when I run

How to avoid calling latex in matplotlib (output to pgf)

隐身守侯 提交于 2020-03-02 03:53:46
问题 I'm using matplotlib with its pgf backend to generate plots that I include in my LaTeX beamer document. I run into trouble when I use latex commands that are not defined. But for my application, I don't need matplotlib to generate the labels or annotations with latex, I only want a correct pgf output and I will call LaTeX on my beamer document. If I would run this code in a notebook, I would expect just to have a plot with a literal "\si{\percent}" in the xlabel. In the MWE below, when I run

Control font size in graphics in LaTeX when scaling in minipage/subfig?

假装没事ソ 提交于 2019-12-20 20:16:09
问题 I am using pgf/tikz graphics and I'm wondering how one can control the scaling of font sizes in the graphics when using them in minipage/subfig environments? Is there a way to manually set a permanent font size for pgf/tikz graphics or in latex in general so as to make font sizing invariant to scaling? Ideally I'd like to be able to manually specify a font size per graphic or for all graphics or subfig/minipage environments? Here is an example of the usage as suggested. Thanks for the help.

savefig PGF - RuntimeError: Cannot get window extent w/o renderer

依然范特西╮ 提交于 2019-12-11 07:42:39
问题 I'm trying to save a figure in pyplot with tight margins. The following code works perfectly with a PDF output: from matplotlib import pyplot as plt plt.plot(1) plt.savefig('test.pdf', bbox_inches='tight') But not with PGF output plt.savefig('test.pgf', bbox_inches='tight') as it returns RuntimeError: Cannot get window extent w/o renderer . Why is this happening and is there a way to work around it? matplotlib 1.3.0rc2 on Ubuntu 13.04 python -c "from matplotlib import pyplot as plt; plt.plot

How could a simple optional argument lead to data corruption?

蓝咒 提交于 2019-12-06 12:55:34
问题 I have a FORTRAN code with a routine: SUBROUTINE READ_NC_VALS(NCID, RECID, VARNAME, VARDATA) integer ncid, recid character*(*) varname real*8 vardata dimension vardata(15,45,75) etc. I want to add some flexibility to this code, and I thought I would do it by first adding an optional flag argument: SUBROUTINE READ_NC_VALS(NCID, RECID, VARNAME, VARDATA, how_to_calculate) ! everything the same and then ... logical, optional :: how_to_calculate Now, at this point, I am not even using "how_to

How could a simple optional argument lead to data corruption?

一世执手 提交于 2019-12-04 19:41:49
I have a FORTRAN code with a routine: SUBROUTINE READ_NC_VALS(NCID, RECID, VARNAME, VARDATA) integer ncid, recid character*(*) varname real*8 vardata dimension vardata(15,45,75) etc. I want to add some flexibility to this code, and I thought I would do it by first adding an optional flag argument: SUBROUTINE READ_NC_VALS(NCID, RECID, VARNAME, VARDATA, how_to_calculate) ! everything the same and then ... logical, optional :: how_to_calculate Now, at this point, I am not even using "how_to_calculate". I am just putting it into the code for testing. So I compile the code without a hitch. Then I

Control font size in graphics in LaTeX when scaling in minipage/subfig?

孤者浪人 提交于 2019-12-03 07:58:14
I am using pgf/tikz graphics and I'm wondering how one can control the scaling of font sizes in the graphics when using them in minipage/subfig environments? Is there a way to manually set a permanent font size for pgf/tikz graphics or in latex in general so as to make font sizing invariant to scaling? Ideally I'd like to be able to manually specify a font size per graphic or for all graphics or subfig/minipage environments? Here is an example of the usage as suggested. Thanks for the help. \begin{figure}[h] \centering \subfloat[Graph 1]{ \begin{minipage}[h]{0.7\linewidth} \centering