Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2562
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: question about plotting |
| Date | 2011-05-21 10:47 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ir858f$bf3$1@smc.vnet.net> (permalink) |
On 5/20/11 at 6:36 AM, krzysztof.kutak@googlemail.com (Krzysztof
Kutak) wrote:
>I would like to combine plot od datapoints in one
>dimension(for this I use ListPlot[data]) with fitted function ( f[r]
>). Do you know how to do this?
Here are a couple of ways:
First generate some data and a fitted curve
data = Sort@RandomReal[10, 10];
f = m x + b /. FindFit[data, m x + b, {m, b}, x];
Then create the plot
Plot[f, {x, 0, 11},
Epilog -> {PointSize[.015], Point[Transpose@{Range[10], data}]}]
Note, if the data were a 2D array the Epilog portion would have been
{Pointsize[.015],Point[data]}
or
Show[ListPlot[data], Plot[f, {x, 0, 11}]]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: question about plotting Bill Rowe <readnews@sbcglobal.net> - 2011-05-21 10:47 +0000
csiph-web