0

I've been trying to produce the following plot:

Sound Intensity Level

And here's mine (No labels, still just trying to get the plot right). My plot

I can't seem to get a square grid, nor can I get the plot to start at -10dB.

Any help would be appreciated.

  • 6
    Post the (relevant part of the) code you used to draw this figure. – Clément Jul 15 '14 at 18:36
  • If you used pgfplots, you can use axis equal or axis equal image to get a square grid. But as it stands, we have no idea how you created the existing figure. – Paul Gessler Jul 15 '14 at 19:04
3

Decided to use tikzpicture environment rather than axis and figured it out.

\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}   

enter image description here

  • You could also accept your own answer to mark this question as solved. – Bobyandbob Mar 7 '18 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.