# Relative error with bands plot I have 2 sets of data imported from excel file, Let say A = 20 21 22 ... 30A B= 0 1 2 3 ... 10 I want to plot A with a relative error of 10%

errordataA= Around[A,Scaled[.1]]


But output was "Around[A, Scaled[0.1]]" not "Around[2+-10%]".

Then I want to create a plot with B.

ListPlot[
{A,
B
}
IntervalMarkers -> "Bands",
Sequence[PlotTheme -> "Scientific",
]


Since the code can't read set A data so the graph does not show. How can I fix this one?

• Around is not defined as a function in your system (it is in blue in your screenshot). Note that Around was introduced in version 12 (2019). What version are you using? Nov 29 '20 at 23:10
• What version of Mathematica are you using? Nov 29 '20 at 23:48
• @MarcoB Now I can use "Around". Just updated to M12. Thanks all Nov 30 '20 at 21:19
• @m_goldberg it was M10 and now I already updated it. Dec 1 '20 at 21:34

The Around expression you mention seems to work fine for me:

a = Around[Range[20, 30], Scaled[0.1]]

(* Out: {Around[20., 2.], Around[21., 2.1], Around[22., 2.2],
Around[23., 2.3], Around[24., 2.4], Around[25., 2.5],
Around[26., 2.6], Around[27., 2.7],
Around[28., 2.8], Around[29., 2.9],
Around[30., 3.]} *)


From there, I think you might want to plot a vs. b, i.e. the a values as ordinates and the values as abscissae. If that's what you want, then that works too, but you will want to Transpose the {b, a} set of data:

a = Around[Range[20, 30], Scaled[0.1]]
b = Range[0, 10]

ListPlot[
Transpose@{b, a},
IntervalMarkers -> "Bands",
PlotTheme -> "Scientific",
] —-

An alternative interpretation after OP’s comments:

ListPlot[
{a, b},
IntervalMarkers -> "Bands",
PlotTheme -> "Scientific",
] • Hi, Thank you very much for your comment. I added the picture above. I have no idea why I could not get output like yours. 2ndly, I want to plot {x,A,x,B} not {A,B}. I guess I can plot it directly if I can get A in terms of the digit. Nov 29 '20 at 22:33
• @user8357568 What do you mean by x in your example? Nov 29 '20 at 23:11
• X is y axis. just give some random numbers. Nov 30 '20 at 7:38
• @user8357568 I see. I’ve added a second output. See if that’s what you meant. Nov 30 '20 at 14:19
• @MacroB Regarding your advice, it works great. I have one more question. How can I plot with Transpose[x,a], Transpose [x,b] and a is a = Around[Range[20, 30], Scaled[0.1]] b is b = Range[0, 10] x = Range[0,1] Dec 1 '20 at 21:30

For versions prior to v12

Clear["Global*"]

Needs["ErrorBarPlots"] // Quiet

a = {1, 0.1} # & /@ Range[20, 30];

b = Range[0, 10];

ErrorListPlot[{a, b}, 