Filling in the gaps - smoothing the curve

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

When I was at school - a long time ago - and I was
plotting with pencil and paper a graph which formed a non-
linear series I would draw a smooth line between the
points using my French curves.

Now I realise that if I plot the same curve today as a
line graph using Excel I can ask Excel to mimic my French
curves and smooth the line, rather than simply joining the
points with straight lines. But what I would really like
to do is to calculate new points which fall on the
smoothed line between the known data points.

For instance, if I have eleven y values to plot at
intervals of x of 10 units between 0 and 100, I would
like to calculate the values of y which would fall on the
smoothed line at each of the 90 intermediate integer
values of x, e.g. for x = 1, x = 2 to x = 9, x = 11, x =
12, etc., etc.

Can anyone help me please? I guess I may need to do this
in VBA, and I have some limited experience of this, but
it's the math which eludes me - never was my strong
subject at school.

Alternatively, is there any way I can get access to the
routine which Excel uses when it smooths the line to draw
the graph?

Any suggestions would be greatly appreciated.

Regards
Andrew
 
[This followup was posted to microsoft.public.excel.charting with an
email copy to Andrew.
Please use the newsgroup for further discussion.]

David Braden has posted code that closely mimics the smooth line that
XL creates. However, my understanding is that the code doesn't match
the curve near the endpoints. For more see
http://www.google.com/[email protected]
or search the google archive of the XL NGs.

--
Trouble finding replies to your posts? Use a newsreader. See the
tutorial 'Outlook Express and Newsgroups' on my web site

Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Excel's chart smoother appears to use Bezier curves. Brian Murphy has
posted code for Bezier curves.

http://www.xlrotor.com/excel_stuff.htm

In most cases, the difference between Bezier curves and cubic splines is
minimal. Tushar has already posted a link to David Braden's code for
cubic splines

Jerry
 
Thank-you, gentlemen, for your replies.

I have experimented, and David Braden's code for cubic
spline interpolation seems to do exactly what I need.

Thanks again

Regards
Andrew
 
Back
Top