title: Latex - Try to muster a Bode plot
body: <p>I'm trying to set up a plot with two y-axis, a Bode plot with amplitude and phase in the same diagram. I use the tikzpicture package with \begin{axis} and \addplot to overlay two graphs. Well, at least that's the idea... The issue I have is that it seems I don't have control over the graphs. I can't set fix intervals for the axis, can't control color/style of plot lines. Please point out if there's something wonky in my try to make a Bode plot. In particular, how do I set style on the lines, one dashed and one solid?</p>
  
  <pre><code>    \begin{figure}[H]
  \centering
  \begin{minipage}{0.9 \textwidth}
  
  \begin{tikzpicture}
  
  %%% AMPLITUDE
  \begin{axis}[
      width=340pt,
      height=180pt,
      xlabel=Frequency,
      xmode = log,
      ylabel=Amplitude [dB],
      axis x line=bottom,
      axis y line=left,
  %   xmin=10, xmax=1000000,
  %   ylabel near ticks,
      legend pos= south west,
      font=\scriptsize,
      legend style={font=\scriptsize,draw=none,fill=none}
      ]
  
  
  \addplot table [color=black, mark=none,dotted,y=$amp$, x=freq, font=\scriptsize]{amp.dat};
  \addlegendentry{$Amplitude$ }
  
  \end{axis}
  
  %%% PHASE
  \begin{axis}[
      width=340pt,
      height=180pt,
  %   xmin=10, xmax=1000000,
      hide x axis,
      axis y line=right,
      xmode = log,
      ylabel=Phase [deg],
  %   ymin=-300, ymax=-120,   
  %   ylabel near ticks,
      legend pos= north east,
      font=\scriptsize,
      legend style={font=\scriptsize,draw=none,fill=none}
      ]
  
  
  \addplot table [mark=none,dashed, y=$phase$, x=freq]{phase.dat};
  \addlegendentry{$Phase$ }
  
  \end{axis}
  
  \end{tikzpicture} 
  
  
  
  
  
  \caption{A Bode-plot of the common source gain stage.} 
  \label{fig:cg_sweep}
  \end{minipage}
  \end{figure}
  </code></pre>
  
  <p>Here's some test data for the plot, if needed: <a href="https://dl.dropboxusercontent.com/u/43498716/cg_sweep.dat" rel="nofollow">https://dl.dropboxusercontent.com/u/43498716/cg_sweep.dat</a></p>
  
  <p>Thanks!</p>