答案1
这会产生一个类似于您的屏幕截图的图表。
\documentclass[border=6mm,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[font=\sffamily,/pgfplots/.cd,width=12cm,height=5cm]
\matrix{
\begin{axis}[xmin=0,xmax=3,ymin=-1,ymax=1,
title=5MHz Gaussian pulse,xlabel={Time ($\mu$s)},ylabel=Amplitude]
\addplot[no markers,smooth,samples=201,domain=0:2.5]
{exp(-9*(x-1.25)*(x-1.25))*cos((x-1.25)*1440)};
\end{axis}\\[5mm]
\begin{axis}[xmin=-10,xmax=10,ymin=0,ymax=1,
xtick={-10,-5,0,5,10},
xlabel={Frequency (MHz)},ylabel=Spectral amplitude]
\addplot[no markers,smooth,samples=201,domain=-10:10]
{0.2*exp(-(x-5)*(x-5))+0.2*exp(-(x+5)*(x+5))};
\end{axis}\\
};
\end{tikzpicture}
\end{document}
siunitx
您可以使用and/or使其更加美观groupplots
。