9

Bug introduced in 10.4 or earlier and persisting through 12.0


Consider the following example:

ClearAll["Global`*"];

Needs["ErrorBarPlots`"];

x=Table[n,{n,1,100}];

SeedRandom[314];
y=RandomReal[{9,10},100];
yErr=RandomReal[{0,1},100];

yWithErrors=Transpose[{Transpose[{x,y}],ErrorBar/@yErr}];

ErrorListPlot[yWithErrors, Joined -> True, PlotStyle -> {Blue}, 
 Epilog -> {PointSize[Large], Point[Transpose[{x, y}]]}, 
 PlotRange -> All, Frame -> True, 
 FrameLabel -> {{"y", ""}, {"x", ""}}, 
 BaseStyle -> {FontSize -> 20, FontFamily -> "Calibri"}, 
 ImageSize -> 600]

Independently if I use PlotRange -> All, PlotRange -> Total or PlotRange -> Automatic the output is:

enter image description here

As you see the error bars are not completely visible.

Is the only solution to see the error bars to set the PlotRange manually?

ErrorListPlot[yWithErrors, Joined -> True, PlotStyle -> {Blue}, 
 Epilog -> {PointSize[Large], Point[Transpose[{x, y}]]}, 
 PlotRange -> {All, {8, 11}}, Frame -> True, 
 FrameLabel -> {{"y", ""}, {"x", ""}}, 
 BaseStyle -> {FontSize -> 20, FontFamily -> "Calibri"}, 
 ImageSize -> 600]

enter image description here

Ruslan
  • 7,152
  • 1
  • 23
  • 52
mrz
  • 11,686
  • 2
  • 25
  • 81
  • seems like a version 10 issue; it doesn't arise in v9 – kglr Jul 18 '16 at 13:01
  • I am running 10.4.1 (Win 64bit Pro). – mrz Jul 18 '16 at 13:03
  • 1
    This is a bug. ErrorListPlot is no longer considering the error bars when calculating the plot range. You get the exact same plot range regardless of how large the errors are. – Jason B. Jul 18 '16 at 14:35
  • 1
    I reported this as a bug. A simpler example that shows the issue would be ErrorListPlot[{.1 #, .8} & /@ Range[10], PlotRange -> All], which also shows the utility of kglr's workaround. – Jason B. Jul 18 '16 at 15:05
  • The same problem with version 11 ... Three weeks ago I informed the technical support and they reproduced the problem with version 10.4.1, but that's it ... – mrz Aug 12 '16 at 08:07

1 Answers1

10

In version 9, PlotRange -> All in ErrorListPlot works as expected:

ErrorListPlot[yWithErrors, Joined -> True, PlotStyle -> {Blue}, 
 Epilog -> {PointSize[Large], Point[Transpose[{x, y}]]}, 
 PlotRange -> All, Frame -> True, 
 FrameLabel -> {{"y", ""}, {"x", ""}}, 
 BaseStyle -> {FontSize -> 20, FontFamily -> "Calibri"}, 
 ImageSize -> 600, PlotLabel -> Style[$Version, 20]]

Mathematica graphics

In versions 10+,

elp=ErrorListPlot[yWithErrors, Joined -> True, PlotStyle -> {Blue}, 
 Epilog -> {PointSize[Large], Point[Transpose[{x, y}]]}, 
 PlotRange -> All, Frame -> True, 
 FrameLabel -> {{"y", ""}, {"x", ""}}, 
 BaseStyle -> {FontSize -> 20, FontFamily -> "Calibri"}, 
 ImageSize -> 600, PlotLabel->Style[$Version, 20]]

gives

Mathematica graphics

A work-around: Wrap the output of ErrorListPlot with Show using the option PlotRange -> All:

Show[elp, PlotRange -> All]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896