- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试设置一个带有两个 y 轴的图,一个波德图,在同一张图中包含振幅和相位。我使用带有\begin{axis} 和\addplot 的 tikzpicture 包来叠加两个图形。好吧,至少那是我的想法……我的问题是我似乎无法控制图表。我无法为轴设置固定间隔,无法控制绘图线的颜色/样式。请指出我在尝试制作博德图时是否有什么不对劲的地方。特别是,如何设置线条的样式,一根虚线,一根实线?
\begin{figure}[H]
\centering
\begin{minipage}{0.9 \textwidth}
\begin{tikzpicture}
%%% AMPLITUDE
\begin{axis}[
width=340pt,
height=180pt,
xlabel=Frequency,
xmode = log,
ylabel=Amplitude [dB],
axis x line=bottom,
axis y line=left,
% xmin=10, xmax=1000000,
% ylabel near ticks,
legend pos= south west,
font=\scriptsize,
legend style={font=\scriptsize,draw=none,fill=none}
]
\addplot table [color=black, mark=none,dotted,y=$amp$, x=freq, font=\scriptsize]{amp.dat};
\addlegendentry{$Amplitude$ }
\end{axis}
%%% PHASE
\begin{axis}[
width=340pt,
height=180pt,
% xmin=10, xmax=1000000,
hide x axis,
axis y line=right,
xmode = log,
ylabel=Phase [deg],
% ymin=-300, ymax=-120,
% ylabel near ticks,
legend pos= north east,
font=\scriptsize,
legend style={font=\scriptsize,draw=none,fill=none}
]
\addplot table [mark=none,dashed, y=$phase$, x=freq]{phase.dat};
\addlegendentry{$Phase$ }
\end{axis}
\end{tikzpicture}
\caption{A Bode-plot of the common source gain stage.}
\label{fig:cg_sweep}
\end{minipage}
\end{figure}
如果需要,这里有一些情节的测试数据:https://dl.dropboxusercontent.com/u/43498716/cg_sweep.dat
谢谢!
最佳答案
这就是您要实现的目标吗?
这是一个pgfplots解决方案。
设置间隔的示例:xmin=10, xmax=1000000
, ymin=10, ymax=35,
...
设置绘图线条颜色和样式的示例:\addplot[红色,虚线]
...
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{set layers}
\begin{axis}[
xmode=log,
xmin=10, xmax=1000000,
ymin=10, ymax=35,
scale only axis,
axis y line*=left,
xlabel=Frequency,
ylabel={Amplitude [dB]},
]
\addplot[blue, solid] table[x=freq,y=$amp$] {cg_sweep.dat};
\label{aplot}
\end{axis}
\begin{axis}[
xmode=log,
xmin=10, xmax=1000000,
ymin=-290, ymax=-140,
scale only axis,
axis y line*=right,
axis x line=none,
ylabel={Phase [deg]},
]
\addlegendimage{/pgfplots/refstyle=aplot}\addlegendentry{$Amplitude$}
\addplot[red, dashed] table[x=freq,y=$phase$] {cg_sweep.dat};
\addlegendentry{$Phase$ }
\end{axis}
\end{tikzpicture}
\end{document}
关于plot - Latex - 尝试收集波德图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33522943/
这是我的问题 1)我有动态y数组数据,使用该数组如何连续绘制波浪。 如果Y数组数据完整,则使用相同的y数组数据继续。 2)声音自动播放在该数组值是143.if我停止不停止。 这是我的代码:
网络上有太多使用 WiFi 或蓝牙传输数据的对讲机应用程序(至少我见过的所有应用程序),但没有一个使用内置天线通过 radio 波传输数据真正的对讲机设备。 是否有任何安全原因?还是限制作为发送器/接
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve this
我正在尝试着手研究 boost wave,但到目前为止,我的运气并不好。 我尝试了网站上的示例代码。如下: #include #include #include #include #inclu
我正在尝试使用 svg 编写一个 javascript 加载器。想法是,它是一个从下到上两侧均匀填充的圆圈,加载器的顶线是一个从左到右不断移动的正弦波。 我能够根据百分比为加载程序创建弧线,如下所示:
这个问题在这里已经有了答案: Is there a one-line function that generates a triangle wave? (8 个答案) 关闭 9 年前。 我试图用 A
当我在论坛中搜索时,我了解到要定位 GPS,我必须通过互联网连接或短信发送坐标。但据我所知,我们可以通过 radio 波进行通信,发送语音、图片、数据。我可以用它来获取数据吗? GPS 设备?因为业余
我是一名优秀的程序员,十分优秀!