
1つのプロットに異なる線をプロットする方法について助けが必要です
例えば、私は
1 = 1;
シータ = [0 30 60 90];
d1 = a.*sind(theta);
d2 = a.*cosd(theta);
プロット (d1,d2)
ただし、同じプロット上に a=2,3,4 の別々の線もプロットしたいと考えています。
答え1
あなたが探しているのはこのようなものですか?
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:90,no markers]
\pgfplotsinvokeforeach{1,2,3,4}{
\addplot ({#1*sin(x)},{#1*cos(x)});
\addlegendentry{$a = #1$};
}
\end{axis}
\end{tikzpicture}
\end{document}