I would like to copy the style of a graph in pgfplots that looks like this:
There are examples for graphs with multiple y-Ordinates in the pgfplots manual but they do not exactly give the output I expect. Here is my code:
\begin{tikzpicture}
\begin{axis}[
scale only axis,
xlabel={Input voltage [V]},
ylabel={left axis},
axis y line*=left,
grid=both,
xmin=0,
xmax=1.8,
ymin=-5,
ymax=90,
width=5cm,
height=5cm,
mark size=2.0pt,
]
\addplot[blue, mark=o] table [x=Vin, y=fg_pc, col sep=comma] {csv/fg_Adc_DC_sweep.csv};
\end{axis}
\begin{axis}[
scale only axis,
xmin=0,
xmax=1.8,
axis x line=none,
axis y line*=right,
ymin=-6,
ymax=2,
grid=both,
ylabel={right axis},
width=5cm,
height=5cm,
]
\addplot[orange, mark=o] table [x=Vin, y=Adc, col sep=comma] {csv/fg_Adc_DC_sweep.csv};
\end{axis}
\end{tikzpicture}
Note that the values in my csv file are not the same as on the first picture. Also note that I need to set the width and height of both axis explicitly, otherwise the two y-axis do not have the same size. This code compiles as follows:
The problems I have:
1) How can I match the grids like in the first picture?
2) How can i change the color of the axis. I tried to follow the solution here. That example compiles without error but does not change the outlook of my plot at all. Is there a better and easier solution?
3) How can I get the second y label to right side too?
Thanks a lot for any advice!