Combine ListPlot and ErrorListPlot in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter wren11
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 6K views
wren11
Messages
1
Reaction score
0
Combine ListPlot and ErrorListPlot in Mathematica??

Hello,

I'm pretty new to Mathematica and I'm having a problem getting error bars on a plot. I've been using ListPlot to graph points and then edit the appearance of the graph / include legend etc by:
ListPlot["meansdata", Frame -> {{True,False},{True,False}},FrameLabel ->{"Month","Group Size"}, FrameTicks -> {{{1,"Jan"},{2,"Feb"},{3,"Mar"},{4,"Apr"},{5,"May"},{6,"Jun"},{7,"Jul"},{8,"Aug"},{9,"Sep"},{10,"Oct"},{11,"Nov"},{12,"Dec"}},Automatic}, PlotLegend -> {"2009","2010"}] plus LegendPosition / PlotStyle / PlotRange etc.

I would like to add in error bars to this plot but it seems the only way to generate a graph with error bars is to use ErrorListPlot. With this, I seem to lose the option to include a legend and changing the appearance isn't working in the same way. I've tried combining the regular ListPlot and the ErrorListPlot with Show. This only works if I haven't included a legend or changed the appearance.

How can I add error bars to a ListPlot and still edit the appearance, legend, ticks etc? Any help would be greatly appreciated!
 
Physics news on Phys.org


try:

hold on

That should "hold" the graph on the screen while you make changes.