\pgfplotsset 的问题

\pgfplotsset 的问题

我通常在我的电脑上工作,但出于奇怪的原因,我不得不在另一台电脑上工作。以下代码以前可以正常工作,但在新电脑上却无法正常工作。我收到了很多我不明白的错误消息(我对 latex 的了解很少)。

我已经在 Windows 10 中安装了 basic-MiKTeX-2.9.7269-x64 和 Texmaker 5.0.3。代码是:

\documentclass[10pt]{article}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{rvwvcq}{rgb}{0.08235294117647059,0.396078431372549,0.7529411764705882}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-11.56,
xmax=11.56,
ymin=-8.5,
ymax=4.5,
xtick={-11,-10,...,11},
ytick={-8,-7,...,4},]
\draw [line width=2pt] (-9.86,-3.89)-- (-9.48,-3.71);
\draw [line width=2pt] (-2.42,1.25)-- (-3.62,-3.99);
\draw [line width=2pt] (8.36,-3.93)-- (7.84,2.07);
\begin{scriptsize}
\draw [fill=rvwvcq] (-6.9,1.43) circle (2.5pt);
\draw[color=rvwvcq] (-6.74,1.86) node {$A$};
\draw [fill=rvwvcq] (-5.24,-1.51) circle (2.5pt);
\draw[color=rvwvcq] (-5.08,-1.08) node {$B$};
\draw [fill=rvwvcq] (0.94,-2.59) circle (2.5pt);
\draw[color=rvwvcq] (1.1,-2.16) node {$C$};
\draw [fill=rvwvcq] (2.56,1.79) circle (2.5pt);
\draw[color=rvwvcq] (2.72,2.22) node {$D$};
\draw [fill=rvwvcq] (-9.86,-3.89) circle (2.5pt);
\draw[color=rvwvcq] (-9.7,-3.46) node {$E$};
\draw [fill=rvwvcq] (-9.48,-3.71) circle (2.5pt);
\draw[color=rvwvcq] (-9.32,-3.28) node {$F$};
\draw[color=black] (-9.46,-3.84) node {$f$};
\draw [fill=rvwvcq] (-2.42,1.25) circle (2.5pt);
\draw[color=rvwvcq] (-2.26,1.68) node {$G$};
\draw [fill=rvwvcq] (-3.62,-3.99) circle (2.5pt);
\draw[color=rvwvcq] (-3.46,-3.56) node {$H$};
\draw[color=black] (-3.26,-1.06) node {$g$};
\draw [fill=rvwvcq] (8.36,-3.93) circle (2.5pt);
\draw[color=rvwvcq] (8.52,-3.5) node {$I$};
\draw [fill=rvwvcq] (7.84,2.07) circle (2.5pt);
\draw[color=rvwvcq] (8,2.5) node {$J$};
\draw[color=black] (8.48,-0.66) node {$h$};
\end{scriptsize}
\end{axis}
\end{tikzpicture}
\end{document}

错误内容是:

line 50 ! Argument of \pgfmathfloatparse@@ has an extra }. <inserted text> \par \end{axis}
line 50 ! Paragraph ended before \pgfmathfloatparse@@ was complete. <to be read again> \par \end{axis}
line 50 ! Extra }, or forgotten \endgroup. <recently read> } \end{axis}
line 50 ! Extra \else. <argument> ...\pgfplots@stored@current@data \else \pgfplots@stored@plotlist@... \end{axis}
line 50 ! Undefined control sequence. <argument> \pgfplots@visphase@names \end{axis}
line 50 ! Argument of \pgfmathfloatparse@@ has an extra }. <inserted text> \par \end{axis} 
line 50 ! Paragraph ended before \pgfmathfloatparse@@ was complete. <to be read again> \par \end{axis}
line 50 ! Extra }, or forgotten \endgroup. <recently read> } \end{axis}
line 50 ! Extra \else. <argument> ...\pgfplots@stored@current@data \else     \pgfplots@stored@plotlist@... \end{axis}
line 50 ! Undefined control sequence. <argument> \pgfplots@visphase@names \end{axis} 
line 50 ! Argument of \pgfmathfloatparse@@ has an extra }. <inserted text> \par \end{axis} 
line 50 ! Paragraph ended before \pgfmathfloatparse@@ was complete. <to be read again> \par \end{axis} 
line 50 ! Extra }, or forgotten \endgroup. <recently read> } \end{axis}
line 50 ! Extra \else. <argument> ...\pgfplots@stored@current@data \else \pgfplots@stored@plotlist@... \end{axis}
line 50 ! Undefined control sequence. <argument> \pgfplots@visphase@names \end{axis}
line 50 ! Argument of \pgfmathfloatparse@@ has an extra }. <inserted text> \par \end{axis}
line 50 ! Paragraph ended before \pgfmathfloatparse@@ was complete. <to be read again> \par \end{axis}
line 50 ! Extra }, or forgotten \endgroup. <recently read> } \end{axis}
line 50 ! Extra \else. <argument> ...\pgfplots@stored@current@data \else \pgfplots@stored@plotlist@... \end{axis}

还有更多。

我已经在很多论坛中寻找解决方案,但没有找到任何解决方案。

谁能帮我?

提前致谢。

答案1

我刚刚回答了一个非常相似的答案,问题总是一样的:您正在使用圆的弃用语法,,circle(<radius>)但应该使用circle[radius=<radius>],这可以解决问题。

\documentclass[10pt]{article}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{rvwvcq}{rgb}{0.08235294117647059,0.396078431372549,0.7529411764705882}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-11.56,
xmax=11.56,
ymin=-8.5,
ymax=4.5,
xtick={-11,-10,...,11},
ytick={-8,-7,...,4},]
\draw [line width=2pt] (-9.86,-3.89)-- (-9.48,-3.71);
\draw [line width=2pt] (-2.42,1.25)-- (-3.62,-3.99);
\draw [line width=2pt] (8.36,-3.93)-- (7.84,2.07);
\begin{scriptsize}
\draw [fill=rvwvcq] (-6.9,1.43) circle[radius=2.5pt];
\draw[color=rvwvcq] (-6.74,1.86) node {$A$};
\draw [fill=rvwvcq] (-5.24,-1.51) circle[radius=2.5pt];
\draw[color=rvwvcq] (-5.08,-1.08) node {$B$};
\draw [fill=rvwvcq] (0.94,-2.59) circle[radius=2.5pt];
\draw[color=rvwvcq] (1.1,-2.16) node {$C$};
\draw [fill=rvwvcq] (2.56,1.79) circle[radius=2.5pt];
\draw[color=rvwvcq] (2.72,2.22) node {$D$};
\draw [fill=rvwvcq] (-9.86,-3.89) circle[radius=2.5pt];
\draw[color=rvwvcq] (-9.7,-3.46) node {$E$};
\draw [fill=rvwvcq] (-9.48,-3.71) circle[radius=2.5pt];
\draw[color=rvwvcq] (-9.32,-3.28) node {$F$};
\draw[color=black] (-9.46,-3.84) node {$f$};
\draw [fill=rvwvcq] (-2.42,1.25) circle[radius=2.5pt];
\draw[color=rvwvcq] (-2.26,1.68) node {$G$};
\draw [fill=rvwvcq] (-3.62,-3.99) circle[radius=2.5pt];
\draw[color=rvwvcq] (-3.46,-3.56) node {$H$};
\draw[color=black] (-3.26,-1.06) node {$g$};
\draw [fill=rvwvcq] (8.36,-3.93) circle[radius=2.5pt];
\draw[color=rvwvcq] (8.52,-3.5) node {$I$};
\draw [fill=rvwvcq] (7.84,2.07) circle[radius=2.5pt];
\draw[color=rvwvcq] (8,2.5) node {$J$};
\draw[color=black] (8.48,-0.66) node {$h$};
\end{scriptsize}
\end{axis}
\end{tikzpicture}
\end{document}

注意此问题已报告但使用非弃用的语法也可以解决这个问题。

相关内容