0

I'd like to be able to draw his diagram in tikz if anyone has pointers on where to begin? Specifically how would you draw the curves?

enter image description here

is there anyway to scale the image using \begin{axis}[width=24cm,height=8cm] as i'd like to stretch a image a bit (3x wide as high)

  • You could just include the image. If you want to try and draw this using tikz you are more likely to get hep if you post some code that shows you have at least tried.... – Andrew Nov 29 '18 at 5:52
  • There is a nice Matlab function called matlab2tikz that does exactly what you're looking for. – G. Gare Nov 29 '18 at 6:39
3

It is rather straightforward to produce something along these lines.

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[font=\sffamily,samples=101]
\draw[stealth-stealth] (0,3)node[left]{X} |- (7,-3) node[below]{$\lambda$};
\draw[thick] plot[variable=\x,domain=0:6] ({\x},{cos(\x*30)+1}) node[right]{B};
\draw[thick] plot[variable=\x,domain=0:6] ({\x},{cos(\x*30)-1}) node[right]{C};
%
\draw plot[variable=\x,domain=0:6] ({\x},{cos(\x*30)}) node[right]{A};
%
\draw[red] plot[variable=\x,domain=0:6,] ({\x},{cos(\x*30)+0.8*cos(\x*120)});
%
\draw[gray] plot[variable=\x,domain=0:6,] ({\x},{cos(\x*30)+0.9*cos(\x*360-45)});
%
\draw[thin,gray] (1,2.8) -- (1,-3) node[below]{D};
\draw[thin,gray] (4.5,2.8) -- (4.5,-3) node[below]{E};
\end{tikzpicture}
\end{document}

enter image description here

  • is there anyway to scale the image using \begin{axis}[width=24cm,height=8cm] as i'd like to stretch a image a bit (3x wide as high) – user175199 Dec 1 '18 at 2:33
  • 1
    @user175199 Sure, just use \begin{tikzpicture}[font=\sffamily,samples=101,xscale=3]. – user121799 Dec 1 '18 at 2:39

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.