jagged edges on masked contour plots

Hi all

I have an application requiring that I do contour plots for masked data.
At the edge of my contour plots, I'm getting fragmented contours due to
missing points on the corner of a cell in my grid.

Is there any way that the contour drawing code can be set up so that it
plots contours even if a cell in the grid only has data on two sides?

I suspect that the rule for contour plots is that no contours are shown
if *any* of the point on the four corners are missing.

There is an example with the jagged edge shown in the attached image.

Cheers
JP

jagged-edge.png

···

--
John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney NSW 2052 Australia
t +61 2 9385 5127
f +61 2 9663 1222
mailto:john.pye_AT_student_DOT_unsw.edu.au
http://pye.dyndns.org/

John,

You are correct about the way contour handles masked data, and I agree that it is ugly; unfortunately, it is inherent in the routine we are using. You could reduce but not eliminate the problem by interpolating to a finer grid.

The routine we are using, which came from the gist package, has the virtues of an acceptable license, production of regular and filled contours, and handling of missing data (but with the problem you note, plus one bug that I have not been able to fix yet.) I think it is also very efficient, although I have not done any benchmarking. If a better routine with the essential virtues could be found, we would probably use it; but I don't know of any. In particular, open source routines that handle filled contours and masking seem to be very rare.

Eric

John Pye wrote:

···

Hi all

I have an application requiring that I do contour plots for masked data.
At the edge of my contour plots, I'm getting fragmented contours due to
missing points on the corner of a cell in my grid.

Is there any way that the contour drawing code can be set up so that it
plots contours even if a cell in the grid only has data on two sides?

I suspect that the rule for contour plots is that no contours are shown
if *any* of the point on the four corners are missing.

There is an example with the jagged edge shown in the attached image.

Cheers
JP

------------------------------------------------------------------------

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options