0
$\begingroup$

This question already has an answer here:

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$

marked as duplicate by Karsten 7., Sjoerd C. de Vries, Bob Hanlon, Öskå, ciao Mar 17 '15 at 22:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Try Needs["ErrorBarPlots`"] $\endgroup$ – Jinxed Mar 17 '15 at 13:45
  • $\begingroup$ Look up "error bars" on this site and in Mathematica's documentation. Many hits. $\endgroup$ – Sjoerd C. de Vries Mar 17 '15 at 18:34
7
$\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$
  • $\begingroup$ Hi Lou, It is strange that when I plot using your codes, the best-fit line is not showing. $\endgroup$ – boyinneed Mar 18 '15 at 6:54
  • $\begingroup$ @boyinneed, do you execute the linear Model fit? $\endgroup$ – user9660 Mar 18 '15 at 8:55
  • $\begingroup$ Yes I do. Thank you (: $\endgroup$ – boyinneed Mar 18 '15 at 12:21

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