I have the following code
Code: Select all
\documentclass{minimal}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
%% common properties for both plots
\pgfplotsset{
xmin = 0,
xmax = 600,
ymin = 0.0,
table/x=np,
xlabel=Number of processors,
scale only axis
}
\begin{tikzpicture}
%% details for first plot with y-axis on left
\begin{axis}[
ymax= 600,
ylabel= Speedup,
axis y line=left,
table/y=speedup
]
\addplot {x}; %% this line is not working. I want a line y=x in the same plot
\addplot [mark=*,dashed] table {scaling.dat};
\end{axis}
%% details for second plot with y-axis on right
\begin{axis}[
ymax= 1,
ylabel=Efficiency,
axis y line=right,
table/y=efficiency
]
\addplot [mark=*,dashed] table {scaling.dat};
\end{axis}
\end{tikzpicture}
\end{document}
Code: Select all
np speedup efficiency
1 1 1
10 9.26 0.926
20 18.73 0.9365
50 43.76 0.8752
100 85.56 0.8556
200 173.72 0.8686
565 441 0.735
Thanks