Hello PLplot developers,
First of all, thank you for developing and maintaining PLplot. I use it regularly and find it very useful.
In my field, we often work with gridded datasets that contain missing values.
Until recently, I thought that PLplot did not provide a way to handle missing values when using plshades. Therefore, when I needed to plot gridded data containing missing cells with plshades, I used the following workaround:
Fill the missing cells by extrapolation or some other method, while keeping track of which cells were originally missing.
Run plshades on the resulting dataset without missing values.
Draw white-filled boxes over the originally missing cells using plfill to mask them out.
However, while looking through the source code, I noticed that set_cond() in plshades.c already handles this case. If I simply pass data in which the missing grid points are set to NaN, PLplot internally recognizes them as missing points and, as intended, draws the shaded regions only over the valid part of the grid.
I use Fortran, so on the user side I can obtain the desired result simply by assigning ieee_quiet_nan to the missing values in the array passed to PLplot.
However, it seems that plcont does not currently provide the same behavior.
I found that the same functionality can apparently be added by applying a small eight-line patch at the beginning of pldrawcn(), as shown in the attached patch.
Would it be possible to incorporate a change like this into the upstream PLplot code?
I am asking here because I am not familiar with the contribution procedure, such as the preferred workflow and conventions for submitting commits or patches.
As far as I can tell, this patch should have no effect on any existing functionality. It is a very local change that simply modifies the existing ipts array, which indicates the grid points where contours may be drawn, so that contours are not drawn around missing points.
Thank you for your consideration.