尝试导入由 matplotlib2tikz 生成的 tikz 图形,但 y 轴的尺寸太大

尝试导入由 matplotlib2tikz 生成的 tikz 图形,但 y 轴的尺寸太大

我正在尝试使用导出的图表matplotlib2tikz,其中包含以下代码:

\begin{tikzpicture}
\begin{axis}[
ylabel={CF [\%]},
xmin=0.5, xmax=7.5,
ymin=0.096, ymax=0.144,
axis on top,
width=\figurewidth,
height=\figureheight,
legend entries={Without Daytime,With Daytime}
]
\addplot [red, dotted, mark=square*, mark options={draw=black}]
coordinates {
(1,0.133436580942456) (2,0.115673379339152) (3,0.120904949173964) (4,0.131747653060196) (5,0.132274436935023) (6,0.13189650135679) (7,0.131731186551343) 
};
\addplot [blue, dotted, mark=diamond*, mark options={draw=black}]
coordinates {
(1,0.109315022898981) (2,0.11263226182201) (3,0.113782540485058) (4,0.107637011084747) (5,0.108459720680927) (6,0.120093612355885) (7,0.120109008832872) 
};
\path [draw=black, fill opacity=0] (axis cs:13,1)--(axis cs:13,1);

\path [draw=black, fill opacity=0] (axis cs:1,13)--(axis cs:1,13);

\path [draw=black, fill opacity=0] (axis cs:13,0)--(axis cs:13,0);

\path [draw=black, fill opacity=0] (axis cs:0,13)--(axis cs:0,13);

\end{axis}

在我的 tex 文件中我有:

\usepackage{tikz}
\usepackage{tkz-fct} 
\usepackage{pgfplots}

\newlength\figureheight
\newlength\figurewidth

和:

\setlength\figurewidth{0.8\textwidth}
\setlength\figureheight{0.625\figurewidth}

\begin{figure}
\centering
\input{.fig1.tikz}
\caption{CAPTION}
\end{figure}

但这给了我:! Dimension too large. <to be read again> ...

ymin将和更改ymax为 0 和 1.5 可以解决问题,但看起来不再那么好了。我知道在乳胶方面我是真正的新手,但我希望有人能帮助我。

答案1

pgf使用中的新后端,matplotlib-1.2.0svn而不是matplotlib2tikz。您需要最近安装的 LaTeX 和 LuaTeX 或 XeTeX。

相关内容