Qing Zhang wrote:
> Hi,
>
> When I plot a contourf(X, Y, Z, V) map with a list of specified values V
> for the contour lines, the map will have blank spaces where Z are not
> in the range specified by V. Is it possible to fill the blank spaces
> with the two colors for the largest and the smallest V values?
>
> Thanks,
>
> Qing
>
Qing,
Yes. One easy way to do this is is to put very large negative and
positive values at the ends of your V array, for example
V = [-100, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 100]
It doesn't matter how large these outside values are, so long as they
encompass all your data. With the default contourf kwarg
clip_ends=True, the color scaling will not use them.
Eric
|