![如何绘制恒定阻尼系数和固有频率 pt2 的 z 网格图](https://linux22.com/image/356148/%E5%A6%82%E4%BD%95%E7%BB%98%E5%88%B6%E6%81%92%E5%AE%9A%E9%98%BB%E5%B0%BC%E7%B3%BB%E6%95%B0%E5%92%8C%E5%9B%BA%E6%9C%89%E9%A2%91%E7%8E%87%20pt2%20%E7%9A%84%20z%20%E7%BD%91%E6%A0%BC%E5%9B%BE.png)
这个问题是从 marsupilam 给出的优雅解决方案构建的:
如何绘制该图的其他部分(来自下面给出的 marsupilam 代码),以便新图是一个完整的圆圈,如下所示:
这是他的超级代码:
\documentclass[12pt,tikz,border=2pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
height=15cm,
unit vector ratio = 1 1,
ymin=0,
xmax=1.1,
ymax=1.1,
samples=100,
axis lines=center,
ticks=none,
]
\pgfplotsinvokeforeach{0,...,9}
{
\def\zet{(.1*#1)}
\pgfmathsetmacro{\factor}{\zet/sqrt(1-\zet^2)}
\addplot[data cs=polar,domain=0:.35*sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x})
node[at end, sloped, anchor=south,font=\tiny, inner sep=0pt] {$\zeta{=}0.#1$};
\addplot[data cs=polar,domain=.35*sqrt(1-\zet^2):sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x});
}
\pgfplotsinvokeforeach{.1,.2,...,1}
{
\def\a{#1}
\addplot[data cs=polar,domain=0:90] ({180*\a*cos(\x)},{exp(-pi*\a*sin(\x))});
}
\end{axis}
\end{tikzpicture}
\end{document}
答案1
这似乎很有效...
在你询问之前:
- 缺少一行,即
zeta=1
。我建议您手工绘制。 - 我不确定下部的 zeta 值,也许
1/0.9, 1/0.8,
等等?
输出
代码
\documentclass[12pt,tikz,border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
height=15cm,
unit vector ratio = 1 1,
xmin=-1.05,
xmax=1.1,
ymin=-1.1,
ymax=1.1,
samples=100,
%axis lines=center,
%ticks=none,
minor tick num=4,
xtick distance=.25,
ytick distance=.1,
major grid style={thick},
xticklabels={,-1,,-0.5,,0,,0.5,,1},
yticklabels={,0,,0.2,,0.4,,0.6,,0.8,,1},
grid=both,
]
\pgfplotsinvokeforeach{0,...,9}
{
\def\zet{(.1*#1)}
\pgfmathsetmacro{\factor}{\zet/sqrt(1-\zet^2)}
\addplot[data cs=polar,domain=0:.35*sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x})
node [at end, sloped, anchor=south,font=\tiny, inner sep=0pt, fill=white,]{$\zeta{=}0.#1$};
\addplot[data cs=polar,domain=.35*sqrt(1-\zet^2):sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x});
\addplot[data cs=polar,domain=0:.35*sqrt(1-\zet^2)] (-180*\x,{exp(-pi*\factor*\x})
node [at end, sloped, anchor=north,font=\tiny, inner sep=2pt, fill=white,]{$\zeta{=}-0.#1$};
\addplot[data cs=polar,domain=.35*sqrt(1-\zet^2):sqrt(1-\zet^2)] (-180*\x,{exp(-pi*\factor*\x});
}
\pgfplotsinvokeforeach{.1,.2,...,1}
{
\def\a{#1}
\addplot[data cs=polar,domain=-90:90] ({180*\a*sin(\x)},{exp(-pi*\a*cos(\x))});
%\addplot[data cs=polar,domain=0:90] ({180*\a*cos(\x)},{exp(-pi*\a*sin(\x))});
}
\end{axis}
\end{tikzpicture}
\end{document}