
단일 플롯에 다른 선을 그리는 데 도움이 필요합니다.
예를 들어, 나는
a = 1;
세타 = [0 30 60 90];
d1 = a.*sind(세타);
d2 = a.*cosd(세타);
플롯(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}