Artifacts in the results of contourf()


I don't remember seeing artifacts like those before. Most likely they come from a bug in the basic contouring routine, cntr.c, which is derived with slight modifications from the routine gcntr.c in gist. Beyond that, its origins seem lost in the murky past. It seems to be old, clever, complicated, and very hard to understand in detail. A few months ago I spent quite a bit of time trying to track down another bug, and I failed.

It might be related to chunking. In cntr.c, try changing line 1384
     long nchunk = 30; /* hardwired for now */

to a different value--say 50--and see if the artifacts change. If they don't, verify that the artifacts are the same when the postscript backend is used.

Good free contouring routines, especially ones that do filled contours and handle data masks, seem remarkably hard to find.



I'd like to ask you several questions related to a figure I've generated ; I apologize in advance for the forthcoming messages, because I've chosen to start a new thread for each question...

My figure is located at . Beware that the file is quite large (over 400 kb).

Now, my first question is: notice the artifacts on the contours of Bz and I at y=0.3 and y=0.55, and on the contours of Q for multiples values of y. These doesn't come from data, as they disappear when zooming in. Do you know where do they come from ? And, more importantly (to me), how to get rid of them ?