我有以下 MWE:
\documentclass[10pt]{article}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}
\pgfplotsset{compat=1.8}
\usepackage{amsmath}
\pgfplotsset{
Cus/.style={
axis equal image,
axis lines = center,
view={0}{90},
xmin=-4.1, xmax=4.1,
ymin=-3.1, ymax=3.1,
domain=-4:4, y domain=-3:3,
xtick={-4,-3,...,4}, ytick={-3,-2,...,3},
samples=10
}
}
\begin{document}
\begin{tikzpicture}[scale=2]
\begin{axis}[
Cus
]
\addplot3[black, quiver={u={1}, v={2*(x-2)*(y+1)}, scale arrows=0.02}] (x,y,0);
\end{axis}
\end{tikzpicture}
\end{document}
我的问题是如何使图中的每个斜率长度相同。还,我怎样才能减小数字的字体大小?
谢谢!
答案1
至于你的第一个问题,你的线条没有标准化。至于你的第二个问题,我只是遵循了 pgfmanual 的第 4.7.4 节。
\documentclass[10pt]{article}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}
\pgfplotsset{compat=1.8}
\usepackage{amsmath}
\pgfplotsset{
Cus/.style={
axis equal image,
axis lines = center,
view={0}{90},
xmin=-4.1, xmax=4.1,
ymin=-3.1, ymax=3.1,
domain=-4:4, y domain=-3:3,
xtick={-4,-3,...,4}, ytick={-3,-2,...,3},
samples=10
}
}
\pgfplotsset{ %<- added
tick label style={font=\tiny},
label style={font=\tiny},
legend style={font=\footnotesize},
}
\begin{document}
\begin{tikzpicture}[scale=2]
\begin{axis}[
Cus
]
\addplot3[black, quiver={u={1/sqrt(1+4*(x-2)^2*(y+1)^2)}, v={2*(x-2)*(y+1)/sqrt(1+4*(x-2)^2*(y+1)^2)}, scale arrows=0.2}] (x,y,0);
\end{axis}
\end{tikzpicture}
\end{document}