Gouri wrote:
Thanks Eric for the suggestion. However I m already using
ZedGraph for plotting. The problem is regarding the algorithm used for
plotting.
You need to pre-process the data you're reading from the file. You can
do a "sticky" calculation to grab the "lowest low" or "highest high" in
every group of 10 or 100 points. However, the problem will be: should
you use the "lowest low" or the "highest high" for a particular set of
10 points. That will depend on whether the overall curve is going up or
down, but you also need to consider if this group of 10 includes a
change in direction.
Some kind of smoothing algorithm is probably what you want.
But it speed isn't the main concern, I'd just make a fullsize plot,
then stick it in a Bitmap and reduce the size down to a thumbnail. .NET
can easily do this for you, but it might lose some of those sticky
inflection points you want to keep.
There are many different algorithms for reducing the size of an image,
and some of them work better for plots. You can google "image scaling",
"linear interpolation", "Bilinear interpolation", and "Bicubic
interpolation". This article is one I was reading the other day:
http://www.compuphase.com/graphic/scale2.htm
He's using "directional averaging", using what appears to be a
convolution matrix. His application is photo reducing, but the ideas
may help you.
Eric