\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\newcommand{\xmax}{14}
\newcommand{\fmin}{(pi/3)}
\newcommand{\fmax}{(2*pi)}
\begin{tikzpicture}[domain=0:\xmax, samples=500]
\draw[ultra thick, red] plot (\x, {sin(deg(exp(ln(\fmin)+\x/\xmax*(ln(\fmax)-ln(\fmin)))*\x))} );
\end{tikzpicture}
\end{document}
如果 LaTeX 多次重复此语句下方的代码,我就会理解。
答案1
我只会在代码中添加注释,希望能解释一切
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
% define some constants
\newcommand{\xmax}{14}
\newcommand{\fmin}{(pi/3)}
\newcommand{\fmax}{(2*pi)}
% begin a tikzpicture that will pass the options domain and samples with the given value to each command inside of it.
\begin{tikzpicture}[domain=0:\xmax, samples=500]
% Use the plot command from tikz on the given function.
% the function will be evaluated between 0 < x < 500 as these were the borders specified in the domain-option
% in total 500 equidistant points of this function will be calculated as this was the value for the samples option
% Every calculated point will be connected to its neighbours which will raise the impression
% that the function was indeed plotted continuously and not for discrete values only.
% You will see what I mean when you set samples to a low value like 5 or something like that.
% In total the function will be evaluated 500 times. Every time \x is set to the respective value and it is up to the code to actually draw a point.
% This is done by the normal coordinate specification in which \x is used as the x-coordinate and the result of the function as the y-coordinate.
% This results in a normal (<number>,{<mathematical expression>}) syntax for coordinates
\draw[ultra thick, red] plot (\x, {sin(deg(exp(ln(\fmin)+\x/\xmax*(ln(\fmax)-ln(\fmin)))*\x))} );
\end{tikzpicture}
\end{document}