Skip to content
Prev 343371 / 398506 Next

Filled vector contours

On 2014-08-24 Prof Brian Ripley wrote:
This was related to the result of example (2), which is more coarse
comparing it to the result of (1).
I appologize for not being precise here.

My goal is to get something like this:
http://drifted.in/other/contours/composition.svg

which is a composition of level plots, e.g.
http://drifted.in/other/contours/level_plot.svg

By 'level plot' I mean the cut of the data at certain level. It is always a
closed polygon (or multiple polygons) consisting of contour lines connected,
if required, by border lines. 

For me it is preferred way over 'isoband', which doesn't include areas
hidden by upper levels:
http://drifted.in/other/contours/isoband.svg

Please note I am not sure if this terminology (isoband, level plot, etc) is
correct.
Thanks a lot for detailed explanation. Now I understand it more.

Most of contouring libraries create the list of line fragments. And this
seems to be the case also of R's 'contourLines'.

But filling the areas requires a further post-processing (joining line
fragments, joining contours, set the correct direction to preserve holes).
And if I understand correctly, this is let to R 'libraries'. Unfortunately,
none of these two is optimal for my use case.

If there is any hidden option or another library (implementing e.g. Marching
squares) which could produce output similar to that linked SVG file, I am
one big ear.

Thanks, Jan