467,891 Members | 1,833 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,891 developers. It's quick & easy.

Plotting a thumbnail of line graph

Hi,

Got a query regarding plotting a preview / thumbnail for a graph
which reads data from a binary file. The preview should should take
very less time, look exactly like the original graph i.e. not miss the
peaks and curves should look similar. Is there algorithm or anyway to
do this in C#.Net.

I have tried plotting points on regular intervals. Saves time but I
m missing peaks and curves don't resemble.

Thanks and Regards,
Gouri

Oct 13 '06 #1
  • viewed: 2266
Share:
4 Replies

Gouri wrote:
I have tried plotting points on regular intervals. Saves time but I
m missing peaks and curves don't resemble.
google ZedGraph.

Oct 13 '06 #2

Thanks Eric for the suggestion. However I m already using
ZedGraph for plotting. The problem is regarding the algorithm used for
plotting.

-Gouri

Oct 16 '06 #3

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

Oct 18 '06 #4
In article <11*********************@b28g2000cwb.googlegroups. com>,
Gouri wrote:
Got a query regarding plotting a preview / thumbnail for a graph
which reads data from a binary file.
A presentation scheme called Sparklines may be of interest.
http://www.networkworld.com/columnis...6gearhead.html and
http://www.bissantz.de/sparklines/ describe this.

Mike

Oct 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by KevinGPO | last post: by
11 posts views Thread by Chapman | last post: by
1 post views Thread by wayne | last post: by
1 post views Thread by wayne | last post: by
7 posts views Thread by diffuser78 | last post: by
8 posts views Thread by Adrian | last post: by
3 posts views Thread by 9966 | last post: by
7 posts views Thread by arslanburney | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.