Version 5 of contour plot

Updated 2002-08-27 10:12:39

Iain B. Findleton posted to comp.lang.tcl:

"Filled contour plots of irregularly spaced values proceeds usually by drawing the contour lines and then doing a flood fill. Drawing the contour lines proceeds by curve follower code (messy, difficult and not generally reliable), or by interpollation using Parzen estimators. There are packages out there that will do this stuff. If you want to do it on a canvas, I think you will find it slow if you implement in pure Tcl. Back in the 80's someone posted a neat algorithm for doing this called "incplot". It used interpolation applied to a scan line to draw the contours. It used really little CPU. I was able to implement it on an 8088 and draw weather maps with reasonable speed. A web search, or a literature search of PC Magazine arricles from the early 80s should find it for you. Unfortunately, it has evaporated from my machine.

A final alternative is to use a rendering algorithm to fit a surface to the points, and using a coloring algorithm to color the surface. OpenGL will do it, as will ray tracing codes and there are some 2D subroutines out there as well"


Category Graphics