I have plotted a spectrum showing "Wavelength" vs "Diffraction Efficiency" and wanted to draw vertical lines indicating some special wavelengths (as shown in the attached image). Here is my written code followed by the data (used "lambda-au.txt").
Code: Select all
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
grid =major,
%grid style={dashed},
% thick,
xlabel= Wavelength $\lambda $ \lbrack $ nm $\rbrack ,
%xtick = {3,5,...,31},
xmax=210,
xmin=20,
ylabel=Diffraction Efficiency, % \lbrack a.u.\rbrack,x
%yticklabels= , %supress the ylabe numbering
%ymax=9,
ymin=0,
mark = none,
legend style = {legend pos=north east,font=\tiny} %place the legend box in the right place at ={(0.85, 0.65)}
]
\pgfplotstableread{lambda-au.txt}
\teff %effs=efficiencies
\addplot [color = blue, mark=none, ] table[y=one] from \teff;
\addlegendentry{m = -1};
\addplot [color = violet, mark=none] table[y=two] from \teff;
\addlegendentry{m = -2};
\addplot [color = red, mark=none] table[y=three] from \teff;
\addlegendentry{m = -3};
\addplot [color = orange, mark=none] table[y=four] from \teff;
\addlegendentry{m = -4};
\addplot [color = green, mark=none] table[y=five] from \teff;
\addlegendentry{m = -5};
\end{axis}
\end{tikzpicture}
\end{document}
Thx in advance.
-Fawad