我一直在尝试创作以下情节:
这是我的(没有标签,仍然只是试图让情节正确)。
我似乎无法获得方形网格,也无法让图从 -10dB 开始。
任何帮助,将不胜感激。
答案1
决定使用 tikzpicture 环境而不是轴并解决这个问题。
\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{figure}[tb]
\begin{center}
\begin{tikzpicture}[scale=0.5]
% Domain
\foreach \x in {0,1,...,16}
\draw [black!30!white](\x,-11) -- (\x,13);
% Range
\foreach \y in {-11,-10,...,13}
\draw [black!30!white](0,\y) -- (16,\y);
% x Axis
\draw [-latex](0,0) -- (16,0);
\foreach \x in {0,1,...,15}
\draw (\x,0.1)--(\x,-0.1);
\foreach \x in {5,10,15}
\draw (\x,0) node [below,inner sep=1pt,below=3pt,rectangle,fill=white]{\x};
% x Axis
\draw [latex-latex](0,-11) -- (0,13);
\foreach \y in {-9,-8,...,11}
\draw (-0.1,\y)--(0.1,\y);
\foreach \y in {-10,-5,0,5,10}
\draw (0,\y) node [left]{\y};
% Decibel
\draw (0,13) node [above]{\textit{dB}};
%P2/P1 Ratio
\draw (16,0) node [right,inner sep=1pt,rectangle,fill=white]{\large $\frac{P_2}{P_1}$};
% Plot function
\draw[domain=0.08:16,samples=200,smooth,variable=\x,blue] plot ({\x},{10*log10(\x)});
% Trace lines
\draw [fill=black,dashed] (0.1,-10)--(0.1,0) node [yshift=8pt,xshift=2pt]{\scalebox{0.7}{$\frac{1}{10}$}} circle (0.1);
\draw [fill=black,dashed] (0.5,-3 )--(0.5,0) node [yshift=8pt,xshift=3pt]{\scalebox{0.7}{$\frac{1}{2}$}} circle (0.1);
% Plot points
\draw [blue,fill=blue](0.1,-10) circle (0.1) node [black,inner sep=1pt,rectangle,fill=white,right=3pt]{One tenth power};
\draw [blue,fill=blue](0.5,-3) circle (0.1) node [black,inner sep=1pt,rectangle,fill=white,right=7pt]{Half power};
\draw [blue,fill=blue](1,0) circle (0.1) node [black,inner sep=1pt,rectangle,fill=white,right,xshift=5pt,yshift=10pt]{Equal power};
\draw [blue,fill=blue](2,3) circle (0.1) node [black,inner sep=1pt,rectangle,fill=white,right=7pt]{Double power};
\draw [blue,fill=blue](10,10) circle (0.1) node [black,inner sep=1pt,rectangle,fill=white,right,yshift=-8pt]{Tenfold power};
\end{tikzpicture}
\end{center}
\caption{Difference in Sound Intensity Level}
\label{fig:sound_intensity_level}
\end{figure}
\end{document}