![如何在 PGFPlots 中制作相同长度的斜率](https://linux22.com/image/372447/%E5%A6%82%E4%BD%95%E5%9C%A8%20PGFPlots%20%E4%B8%AD%E5%88%B6%E4%BD%9C%E7%9B%B8%E5%90%8C%E9%95%BF%E5%BA%A6%E7%9A%84%E6%96%9C%E7%8E%87.png)
我有以下 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}