Plotting ErrorBars with a different style
You do not have to re-implement anything, just use a little chicanery:
ErrorListPlot[
data,
PlotStyle -> Directive[Thick, PointSize -> 0.015],
ImageSize -> Large,
PlotMarkers -> Automatic,
ErrorBarFunction -> (ErrorBarPlots`Private`ebarfun[##] /. l_Line :> {[email protected], l} &)
]
Here is an alternative you might like based on an answer I got to a previous question of mine: Plotting Error Bars on a Log Scale
ClearAll[ePlot, ePlotFunc, plusMinusMean];
plusMinusMean[a_, b_] := {a + b, a - b, a};
ePlot[plotFun_, dataX_, plusMinList_, color_] := Block[{f},
f[y_] := Transpose[{dataX, y}];
plotFun[{
f[plusMinList[[All, 1]]], f[plusMinList[[All, 2]]],
f[plusMinList[[All, 3]]]}, Filling -> {1 -> {2}},
Joined -> {True, True, True},
PlotStyle -> {Opacity[0], Opacity[0], Darker@color},
PlotMarkers -> {Graphics@{Disk[]}, 0.03},
FillingStyle -> Directive[Opacity[0.2], color], Frame -> True,
Axes -> False]]
ePlotFunc[data_, color_] :=
Module[{dataY, dataX, errorY, plusMinList},
dataY = data[[All, 2]];
dataX = data[[All, 1]];
errorY = data[[All, 3]];
plusMinList = Thread[plusMinusMean[dataY, errorY]];
ePlot[ListPlot, dataX, plusMinList, color]]
colors = {Hue[0.67, 0.6, 0.6], Hue[0.85, 0.6, 0.6]};
data = Table[{x, f[x], RandomReal[]}, {f, {Exp[2 #] &, Exp}}, {x, -5,
2, 0.2}];
Show@MapThread[ePlotFunc, {data, colors}]
I hope you might be able to adapt this to your needs, see another example:
Points are stylled with PlotStyle
, Lines with ReplaceAll
:
ErrorListPlot[data,
PlotStyle -> Directive[Thick, PointSize -> 0.01], ImageSize -> Large
] /. x_Line :> {[email protected], x}
(it was Sequence[[email protected],x] before rcollyer comment)
It is not allways so short, in case of more objects in Plot/Show
etc. one has to specify pattern more carefully.