0
$\begingroup$

I have been adding error bars to data points like this:

Needs["ErrorBarPlots`"]
ErrorListPlot[{{{1, 1}, ErrorBar[0.2]}, {{2, 2}, 
   ErrorBar[0.2]}, {{3, 4}, ErrorBar[0.2]}, {{4, 6}, 
   ErrorBar[0.2]}, {{5, 7}, ErrorBar[0.2]}, {{6, 10}, 
   ErrorBar[0.2]}}] 

However, this is very tedious to do if you have a lot of data points. Is there a way to define a "Error bar function" which can be automatically applied to all points instead of typing everything manually? Thank you.

$\endgroup$
2
  • 1
    $\begingroup$ Which version of Mathematica are you using? The options available to you depend on the version. Is Around available to you?. In which format do you have your data and errors? Please edit your question to add all the relevant information. $\endgroup$
    – rhermans
    Jan 11 at 10:47
  • $\begingroup$ ErrorListPlot[{#, ErrorBar[0.2]} & /@ data]? $\endgroup$
    – kglr
    Jan 11 at 10:52
2
$\begingroup$
pts = {{1, 1}, {2, 2}, {3, 4}, {4, 6}, {5, 7}, {6, 10}};
clist = {#[[1]], Around[#[[2]], 0.2]} & /@ pts

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.