1
$\begingroup$

I want to plot 3 data sets in an ErrorListPlot. Two of these data sets can use the same vertical axis but one has another scale and I want to show them in the same Plot with two different vertical axis. I just found this for normal ListPlots, but not for ErrorListPlot. Can you help me?

Sincerely

Edit:
Sampledata:

data1 = {{{1,-40}, ErrorBar[0.5]}, {3,-42}, ErrorBar[0.5]},{5,-43}, ErrorBar[0.5]},};
data2 = {{{1,-20}, ErrorBar[0.5]}, {3,-22}, ErrorBar[0.5]},{5,-26}, ErrorBar[0.5]},};
data3 = {{{1,19}, ErrorBar[0.5]}, {3,25}, ErrorBar[0.5]},{5,30}, ErrorBar[0.5]},};  

data1 and data2 should have the same axis, data3 the other.

I tried serveral things from this post. But nothing really helps.

$\endgroup$
  • 1
    $\begingroup$ Please include more details, e.g. some sample data perhaps, any code that you have tried so far, and references to the existing implementation for ListPlot. You should include these details by editing your original post. $\endgroup$ – MarcoB Dec 9 '15 at 17:21
1
$\begingroup$
data1 = {{{1, -40}, ErrorBar[0.5]}, {{3, -42}, ErrorBar[0.5]}, {{5, -43}, ErrorBar[0.5]}};
data2 = {{{1, -20}, ErrorBar[0.5]}, {{3, -22}, ErrorBar[0.5]}, {{5, -26}, ErrorBar[0.5]}};
data3 = {{{1, 19}, ErrorBar[0.5]}, {{3, 25}, ErrorBar[0.5]}, {{5, 30},ErrorBar[0.5]}};

Needs["ErrorBarPlots`"]

p1 =
  ErrorListPlot[data1,
   ImagePadding -> 45,
   Frame -> {True, True, True, False},
   FrameTicks -> {All, All, None, None},
   GridLines -> Automatic,
   ImageSize -> Large,
   PlotRange -> {{0, Automatic}, {-45, -15}},
   PlotStyle -> Red];

p2 =
  ErrorListPlot[data2,
   Axes -> False,
   ImagePadding -> 45,
   ImageSize -> Large,
   PlotRange -> {{0, Automatic}, {-45, -15}},
   PlotStyle -> Green];

p3 =
  ErrorListPlot[data3,
   Axes -> False,
   ImagePadding -> 45,
   Frame -> {False, False, False, True},
   FrameStyle -> {Automatic, Automatic, Automatic, Blue},
   FrameTicks -> {None, None, None, All},
   ImageSize -> Large,
   PlotRange -> {{0, Automatic}, All},
   PlotStyle -> Blue];

Overlay[{p1, p2, p3}]

enter image description here

$\endgroup$
  • $\begingroup$ I tried this version but I failed to add FrameLabels. Now it works.. strange. But thanks buddy! $\endgroup$ – Phil Dec 10 '15 at 9:44

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.