1
$\begingroup$

enter image description here

Mathematica ListPlot function allows me to plot the above data with omega on the x-axis and CD on the y-axis

enter image description here

1) How do I incorporate the error bars in my data on the graph? 2) Are there any basis statistical analysis I could possibly extract from my exists data table?

$\endgroup$
2
  • $\begingroup$ Try Needs["ErrorBarPlots`"] $\endgroup$
    – Jinxed
    Commented Mar 17, 2015 at 13:45
  • $\begingroup$ Look up "error bars" on this site and in Mathematica's documentation. Many hits. $\endgroup$ Commented Mar 17, 2015 at 18:34

1 Answer 1

8
$\begingroup$
MyData = {{0.5, 0.476}, {0.8, 0.55}, {1.15, 0.703}, {1.3, 0.733}};
error = {0.009, 0.03, 0.003, 0.015};
withError = Transpose[{MyData[[All, 1]], MyData[[All, 2]], error}]

{{0.5, 0.476, 0.009}, {0.8, 0.55, 0.03}, {1.15, 0.703, 0.003}, {1.3, 0.733, 0.015}}

Needs["ErrorBarPlots`"]
Show[ListPlot[MyData], Plot[lm[x], {x, 0, 5}],ErrorListPlot[withError,
PlotStyle -> Red]]

enter image description here

See also: ErrorListPlot

$\endgroup$
3
  • $\begingroup$ Hi Lou, It is strange that when I plot using your codes, the best-fit line is not showing. $\endgroup$
    – boyinneed
    Commented Mar 18, 2015 at 6:54
  • $\begingroup$ @boyinneed, do you execute the linear Model fit? $\endgroup$
    – user9660
    Commented Mar 18, 2015 at 8:55
  • $\begingroup$ Yes I do. Thank you (: $\endgroup$
    – boyinneed
    Commented Mar 18, 2015 at 12:21

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