User controlled colors and levels in contour(f) plots

76 views
Skip to first unread message

Bernd Becker

unread,
May 9, 2013, 6:00:53 AM5/9/13
to scitoo...@googlegroups.com
I would like to share with you this little piece on setting up your own colours in IRIS.
And also I would like to share the experience of setting user specified contour levels and colours in contourf,
which I think  still needs some work.
(but it has been brought to the attention of developers, so should be in good hands.)

The piece sets 100 colours by RGB values. Plotting the user defined colour table is optional.

Later I would like to contour a global field with a choice of colours from said table at user defined contours and use the extend="both" option.

See what happens when you run the program.

Best regards,
Bernd.
testcol.py

Phil Elson

unread,
May 23, 2013, 10:21:55 AM5/23/13
to scitoo...@googlegroups.com
Hi Bernd,

Thanks very much for sharing this - I think there are some really useful nuggets of information in that source code.
I've tried to distil the useful parts into a notebook so that it can be seen easily in a web browser. My notebook relies on versions of matplotlib and cartopy not yet released, but my expectation is that this code should work as-is once a new matplotlib & cartopy release have been made.

The notebook can be found here: http://nbviewer.ipython.org/5636372

Hope it's useful - I'd be happy to make adjustments if you have any feedback, though if we get into deeper matplotlib questions we could discuss on the matplotlib-users mailinglist.

Cheers,
Reply all
Reply to author
Forward
0 new messages