我又对照了标准文件里的样例图形。优化了一下代码,现在图形的变化趋势(曲率)基本一致了,昨天编译文件里未考虑到自变量的平方,所以图形不精确。当我修改X的取值范围,domain=1e0:1e4后就报错了,蓝圈位置的10的4次方刻度值加不进图,即红色曲线显示不完整。请老师有时间再帮我分析一下,感激。
\documentclass[1pt]{standalone}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{euler}
%\usepackage{MnSymbol}
%\usepackage{stmaryrd}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepgfplotslibrary{colormaps}
\usetikzlibrary{pgfplots.groupplots,matrix}
\pgfplotsset{height=8cm,width=8cm}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
enlargelimits=false,
grid=both,
ymin=5e-6,ymax=1,
ymode=normal,
xlabel= undulations per revolution(UPR),
ylabel=amplitude transmission,
log basis y=10,
log basis x=10,
domain=1e0:1e3,samples=60,smooth,
]
\addplot+[no marks,ultra thick,black]{exp(((0.4697*1/15*x)^2)*(-3.1415))};
\addplot+[no marks,ultra thick,black]{exp(((0.4697*1.25/50*x)^2)*(-3.1415))};
\addplot+[no marks,ultra thick,black]{exp(((0.4697*1.5/150*x)^2)*(-3.1415))};
\addplot+[no marks,ultra thick,black]{exp(((0.4697*1.75/500*x)^2)*(-3.1415))};
\addplot+[no marks,ultra thick,red,opacity=0.8]{exp(((0.4697*2/1500*x)^2)*(-3.1415))};
\end{loglogaxis}
\end{tikzpicture}
\end{document}
l3fp
帮助计算xmax=1e4
选项才能显示完整.\documentclass[1pt]{standalone}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{euler}
%\usepackage{MnSymbol}
%\usepackage{stmaryrd}
\usepackage{xcolor}
%use xfp package
\usepackage{xfp}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepgfplotslibrary{colormaps}
\usetikzlibrary{pgfplots.groupplots,matrix}
\pgfplotsset{height=8cm,width=8cm}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
enlargelimits=false,
grid=both,
ymin=5e-6,ymax=1,
xmax=1e4,
ymode=normal,
xlabel= undulations per revolution(UPR),
ylabel=amplitude transmission,
log basis y=10,
log basis x=10,
domain=1e0:1e4,samples=60,smooth,
]
% use \fpeval with xfp, x --> \x
\addplot+[no marks,ultra thick,black]{\fpeval{exp(((0.4697*1/15*\x)^2)*(-3.1415))}};
\addplot+[no marks,ultra thick,black]{\fpeval{exp(((0.4697*1.25/50*\x)^2)*(-3.1415))}};
\addplot+[no marks,ultra thick,black]{\fpeval{exp(((0.4697*1.5/150*\x)^2)*(-3.1415))}};
\addplot+[no marks,ultra thick,black]{\fpeval{exp(((0.4697*1.75/500*\x)^2)*(-3.1415))}};
\addplot+[no marks,ultra thick,red,opacity=0.8]{exp(((0.4697*2/1500*x)^2)*(-3.1415))};
\end{loglogaxis}
\end{tikzpicture}
\end{document}