ListLogPlot with uncertainties in both coordinates

I have a dataset like this:

data =
{{3.17, 2.41*^10}, {4.43, 2.37*^10}, {5.54, 2.27*^10}, {6.87, 2.15*^10},
{8.52, 1.98*^10}, {10.5, 1.85*^10}, {13.14, 1.8*^10},{14.74, 1.81*^10}};


and I want to plot them via ListLogPlot.

Now, I would like to show 10% uncertainty in x and 5% uncertainty in y. I know, I can use the Around function for this. Written out by hand it looks like this:

data2 =
{{Around[3.17, Scaled[0.1]], Around[2.41*^10, Scaled[0.05]]},
{Around[4.43, Scaled[0.1]], Around[2.37*^10, Scaled[0.05]]},
{Around[5.54, Scaled[0.1]], Around[2.27*^10, Scaled[0.05]]},
{Around[6.87, Scaled[0.1]], Around[2.15*^10, Scaled[0.05]]},
{Around[8.52, Scaled[0.1]], Around[1.98*^10, Scaled[0.05]]},
{Around[10.5, Scaled[0.1]], Around[1.85*^10, Scaled[0.05]]},
{Around[13.14, Scaled[0.1]], Around[1.8*^10, Scaled[0.05]]},
{Around[14.74, Scaled[0.1]], Around[1.81*^10, Scaled[0.05]]}};


With ListLogPlot[data2], I get the a plot:

Is there any way to automatize the definition of the 2nd dataset? My actual datssets are much larger, and I have many of them. I assume something like Map could be used.

I'm open for any idea. Maybe there is even a more elegant way directly in the ListLogPlot function.

• Using ReplaceAll, consider: data /. {x_, y_} :> {Around[x, Scaled[0.1]], Around[y, Scaled[0.05]]}
– ktm
Commented Jan 24, 2020 at 21:41

You can use MapThread for this. Like so:

data =
{{3.17, 2.41*^10}, {4.43, 2.37*^10}, {5.54, 2.27*^10}, {6.87, 2.15*^10},
{8.52, 1.98*^10}, {10.5, 1.85*^10}, {13.14, 1.8*^10},{14.74, 1.81*^10}};
MapThread[{Around[#1, Scaled[0.1]], Around[#2, Scaled[0.05]]} &, Transpose[data]]

{{3.17 ± 0.32, (2.41±0.12)×10^10}, {4.4±0.4, (2.37±0.12)×10^10},
{5.5±0.6, (2.27±0.11)×10^10}, {6.9±0.7, (2.15±0.11)×10^10},
{8.5±0.9, (1.98±0.10)×10^10}, {10.5±1.1, (1.85±0.09)×10^10},
{13.1±1.3, (1.80±0.09)×10^10}, {14.7±1.5, (1.81±0.09)×10^10}}

ClearAll[threadAround]


Example:

data = {{3.17, 2.41*^10}, {4.43, 2.37*^10}, {5.54, 2.27*^10}, {6.87, 2.15*^10},
{8.52, 1.98*^10}, {10.5, 1.85*^10}, {13.14, 1.8*^10}, {14.74, 1.81*^10}};



Alternatively,

ClearAll[threadAround2]

• I like the idea with the function. But I don't understand your threadAround2, this function produces asymmetric errors.