我正在寻找 5 个包 pgfkeys 错误的解决方案。我认为问题的根源是一样的。我初步测试了 pgfplot 版本是否与我安装的版本 (v1.13) 以及我在代码中使用的版本 (compat=1.13) 相同。我的 tex 代码:
\listfiles
\documentclass[ngerman]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usepackage{environ}
\usepackage[ngerman]{babel}
\usepackage[babel,german=quotes]{csquotes}
\usepackage{amsmath}
\usepackage{sistyle}
\SIstyle{German}
%============================================================================
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[title={Paris Plot ElastomerXY},title style={text width=8cm,font=\tiny},ylabel={$dc/dn$ in \SI{}{mm/cycle}}, xlabel={$T$ in \SI{}{N/mm}}, legend style={cells={anchor=west}, legend pos=north west, tiny}, xmin=0.45, xmax=2.5, ymin=1E-6, ymax=0.01]
\pgfplotstableread{Daten/T_10A_x.dat} \datatable
\addplot[green!60!black, mark=triangle*,only marks] table[x index=3, y index=5] {\datatable};
\addlegendentry{Data of Mrs X};
\addplot[green!60!black, mark=triangle, only marks] table[x index=9, y index=11] {\datatable};
\addlegendentry{Data of Mr Y};
\addplot[green!60!black, mark=none,domain=0.52:2.09,samples=100]{6.1876E-5*x^1.38671};
\addplot[green!60!black, dashed, mark=none,domain=0.53:2.03,samples=100]{8.23473E-5*x^1.3867};
\end{loglogaxis}
\end{tikzpicture}
\end{document}
错误:
! Package pgfkeys Error: I do not know the key '/tikz/width', to which you passed '4cm', and I am going to ignore it. Perhaps you misspelled it.
! Package pgfkeys Error: I do not know the key '/tikz/height', to which you passed '', and I am going to ignore it. Perhaps you misspelled it.
! Package pgfkeys Error: I do not know the key '/tikz/max space between ticks', to which you passed '12', and I am going to ignore it. Perhaps you misspelled it.
! Package pgfkeys Error: I do not know the key '/tikz/major tick length', to which you passed '0.1cm', and I am going to ignore it. Perhaps you misspelled it.
! Package pgfkeys Error: I do not know the key '/tikz/minor tick length', to which you passed '0.066cm', and I am going to ignore it. Perhaps you misspelled it.
我将非常感激能够找到解决方案。
补充:
T_10A_x.dat
PK MWE1 STABWE1 MT1 STABT1 MDCDN1 STABMDCDN1 MWE2 STABWE2 MT2 STABT2 MDCDN2 STABMDCDN2
2 0.052799144 0.002363125 0.521654964 0.071112212 1.6302E-05 4.38245E-05 0.046990654 1.774E-03 0.527688702 nan 6.706E-05 7.2824E-05
3 0.05332986 0.002374846 0.640799468 0.145810547 1.77546E-05 4.92628E-05 0.046085321 0.001678041 0.66021389 nan 5.22514E-05 5.35509E-05
6 0.055023074 0.002286157 0.854679167 0.140646074 7.48306E-05 0.000243076 0.045130508 0.002649089 0.732226449 nan 7.34344E-05 5.33923E-05
4 0.09842756 0.003199639 1.161353193 0.164903611 6.86283E-05 0.000108369 8.518E-02 0.003124106 1.187725754 nan 9.8963E-05 6.86056E-05
5 0.097294229 0.003299059 1.143703583 0.178297552 8.41961E-05 0.000117132 0.084425 0.002596193 1.320494764 nan 9.3594E-05 7.50381E-05
10 0.093909204 0.003743834 1.086642855 0.1553737 5.42785E-05 0.00011677 0.081561765 2.839E-03 1.181484578 nan 7.72386E-05 4.29831E-05
12 0.159165529 0.008062109 2.093146892 0.599052547 0.000153294 0.000163905 0.13522 0.004191062 1.956414847 nan 0.000195847 0.000100594
13 0.154518522 0.008613584 1.806539562 0.758680826 0.000124254 0.000161388 0.133773171 0.003791242 2.038E+00 nan 0.000213969 0.000287621
14 0.146225517 0.009956112 1.850506661 0.552970808 0.000186329 0.000167609 0.125442105 0.00538561 1.802407552 nan 0.000231828 8.97119E-05
结果我得到:
但是如果我在文章环境中使用更多图表,我就无法忽略错误。
答案1
顺便说一句,问题出在以下事实:,pgfplots
有预定义的样式来快速缩放图表,例如normalsize, tiny, small, footnotesize
等。在这里,轴选项泄露给图例,其中键系列是 TikZ,但键是pgfplots
键。因此出现错误。
/pgfplots/tiny/.style={
width=4cm,
height=,
legend style={font=\tiny},
tick label style={font=\tiny},
label style={font=\tiny},
title style={font=\footnotesize},
every axis title shift=0pt,
max space between ticks=12,
every mark/.append style={mark size=6},
major tick length=0.1cm,
minor tick length=0.066cm,
every legend image post/.append style={scale=0.8},
},
答案2
legend style={cells={anchor=west}, legend pos=north west, font=\tiny}
代替
legend style={cells={anchor=west}, legend pos=north west, tiny}
这个解决方案有效。
谢谢@percusse