Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2562 > unrolled thread

Re: question about plotting

Started byBill Rowe <readnews@sbcglobal.net>
First post2011-05-21 10:47 +0000
Last post2011-05-21 10:47 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: question about plotting Bill Rowe <readnews@sbcglobal.net> - 2011-05-21 10:47 +0000

#2562 — Re: question about plotting

FromBill Rowe <readnews@sbcglobal.net>
Date2011-05-21 10:47 +0000
SubjectRe: question about plotting
Message-ID<ir858f$bf3$1@smc.vnet.net>
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}]]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web