I'm just emailing with a suggestion for the various plshade routines. I often have data which is nearly regular in that it is on a regular grid with some points missing, either because the data doesn't fill the whole domain or because some data has been flagged as bad. Up to now I'd been padding these points with MAX_DOUBLE, which takes these regions off scale and they don't get plotted, except around the edges of the gaps where I get a line with the maximum value of my colourscale. I just had a case where this was particularly ugly so have had a look at the plshade code to see if I could see a better way. A solution I came up with was to flag bad data or gaps with nans by changing setcond to:
static void
set_cond( register int *cond, register PLFLT *a, register PLINT n )
    while ( n-- )
        if ( *a < sh_min )
            *cond++ = NEG;
        else if ( *a > sh_max )
            *cond++ = POS;
        else if ( *a != *a )            //check for nans and set cond to undefined
            *cond++ = UNDEF;
            *cond++ = OK;
A comparison of the two methods for my case can be found at
Any thoughts?