ListLogLogPlot with ErrorBars
You can always perform coordinate transformation yourself. There is nothing so special about LogLogPlot
. You have to apply Log
to your points and plot it with regular ErrorListPlot
. Keep in mind that your error bar won't be symmetric in log-log coordinates. After that you have to draw ticks according to your new scale.
This can be overkill for log-log case, but it gives you generic algorithm how to torture your axes any way you want.
Needs["ErrorBarPlots`"]
plotrange={Floor@Log10@Min[#],Ceiling@Log10@Max[#]}&@dataWithError[[All,#]]&/@{1,2};
logData={{Log10[#[[1]]],Log10[#[[2]]]},ErrorBar[Log10[1+0.5#]&/@{-#[[3]]/#[[2]],#[[3]]/#[[2]]} ] }&/@dataWithError;
xticks = {#,Superscript[10,#]}&/@Range[#1,#2,1]&@@plotrange[[1]];
yticks = {#,Superscript[10,#]}&/@Range[#1,#2,1]&@@plotrange[[2]];
{xt,yt}=#~Join~({#,""}&/@Flatten[(#[[1]]+Log10[{2,3,4,5,6,7,8,9}])&/@#])&/@{xticks,yticks};
ErrorListPlot[logData, Joined -> True, PlotRange->plotrange,FrameTicks->{{yt,None},{xt,None}},Frame->True,Axes->False]
In Mathematica 12, you can use the new Around function inside ListLogLogPlot
. No need for ErrorBarPlots
any more.
toPlot = Map[({#[[1]], Around[#[[2]], #[[3]]]}) &, dataWithError];
ListLogLogPlot[toPlot, Joined -> True, Frame -> True]