If a data array has NaNs and as_outline=True in Plot.add_layer(), then those NaN values will be filled in as borders, including the medial wall. This is not expected behaviour.
The simplest way around this is to use numpy's nan_to_num() just before calling get_labeling_border(). When zero_transparent=True, these values will return to NaN. I don't know if there's any use case that would require zero_transparent=False with as_outline=True, given that you probably don't want to outline 0 values in general.
If a data array has NaNs and
as_outline=True
inPlot.add_layer()
, then those NaN values will be filled in as borders, including the medial wall. This is not expected behaviour.The simplest way around this is to use numpy's
nan_to_num()
just before callingget_labeling_border()
. Whenzero_transparent=True
, these values will return to NaN. I don't know if there's any use case that would requirezero_transparent=False
withas_outline=True
, given that you probably don't want to outline 0 values in general.