程序包 pgfkeys 错误:我不知道密钥“/tikz/5”
尽管我不知道错误出在哪里,但我还是在“\end{axis}”行不断收到此错误。
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[xmin=-1,5, xmax=2,5, ymin=-1, ymax=2,samples=100,grid=minor]
\addplot[black, thin](x,0);
\addplot[blue, thick](x,x - x^2);
\end{axis}
\end{tikzpicture}
\end{center}
\结束{文档}
答案1
2.5 代替 2,5,1.5 代替 1,5:
\documentclass{article}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[xmin=-1.5, xmax=2.5, ymin=-1, ymax=2,samples=100,grid=minor]
\addplot[black, thin](x,0);
\addplot[blue, thick](x,x - x^2);
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}