blank spaces in the map of contourf(X, Y, Z, V)

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 Zhang, Ph.D. Molecular Graphics Laboratory
Research Associate Department of Molecular Biology
                                The Scripps Research Institute
Tel: 858-784-2333 10550 North Torrey Pines Road
Fax: 858-784-2860 Mail Drop: MB-5
Email: qzhang@...448... La Jolla, CA 92037
----------------------------------------------------------------

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