Message Boards Message Boards

0
|
6172 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Why is ErrorListPlot plotting a point in the wrong place?

Posted 9 years ago

Greetings. I am generating a plot with error bars using ErrorListPlot, and I've come across a strange bug. I am three pairs of points, each with x and y error bars. One of the points is not plotting properly. The point should be located at coordinates (0.05, 0.86) and have error bars of dx=0.01 and dy=0.2. However, when I plot it the point actually shows up at about (0.17,0.59) and has no error bars. It is also the wrong marker, and the point disappears entirely if I change my code to "Join->False". The other five points plot perfectly. Here's the really interesting part: if I decrease the vertical position to about 0.8, the point appears in the correct location with the correct error bars. If I change the vertical position to 1, then the incorrect point shifts over to about (0.19,0.59), and the higher I choose the vertical position, the more the false point moves to the right. Also, if I only plot two of the three pairs, then everything works fine.

Any advice would be greatly appreciated. I have seen this issue on Mathematica 10.0.2 and 10.1.0. Thanks!

Here is the code I am using (I have bolded the troubled point, but it's not that way in my code):

ErrorListPlot[{{{{0.3, 0.2}, ErrorBar[0.14, 0.1]}, **{{0.05, 0.86}, ErrorBar[0.01, 0.2]}**}, {{{0.7, 0.024}, 
    ErrorBar[0.14, 0.005]}, {{0.48, 0.15}, 
    ErrorBar[0.13, 0.041]}}, {{{0.65, 0.0007}, 
    ErrorBar[0.2, 0.0002]}, {{0.34, 0.25}, ErrorBar[0.18, 0.13]}}}, 
 Joined -> True, Mesh -> All, PlotMarkers -> {Automatic, Medium}, 
 PlotStyle -> {Blue, Red, Darker[Green]}]
POSTED BY: Trevor Smith
2 Replies
Posted 9 years ago

Hello Trevor,

this is what I got with M10.1.0 after adding "PlotRange -> All" to your code. It seems to work up to expectations.

In[1]:= Needs["ErrorBarPlots`"]

ErrorListPlot[{
  {
   {{0.3, 0.2}, ErrorBar[0.14, 0.1]}, {{0.05, 0.86}, 
    ErrorBar[0.01, 0.2]}
   },
  {
   {{0.7, 0.024}, ErrorBar[0.14, 0.005]}, {{0.48, 0.15}, 
    ErrorBar[0.13, 0.041]}
   },
  {
   {{0.65, 0.0007}, ErrorBar[0.2, 0.0002]}, {{0.34, 0.25}, 
    ErrorBar[0.18, 0.13]}
   }
  },
 Joined -> True, Mesh -> All, PlotMarkers -> {Automatic, Medium}, 
 PlotStyle -> {Blue, Red, Darker[Green]}, PlotRange -> All
 ]

ErrorListPlot

POSTED BY: Michael Helmle
Posted 9 years ago

Thank you so much. This solution worked perfectly.

POSTED BY: Trevor Smith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract