Hi Eric, thanks for the tip about the legend.
Regarding the data, assuming i am using pcolor, am I right in thinking
that using Boundarynorm would be the best way to control the colors for
each code?
Thanks
Mat
On 04/09/2012 06:26 PM, Eric Firing wrote:
On 04/09/2012 02:22 AM, Mathew Topper wrote:
Dear matplotlib-users,
I have a spatial data set that has coded values for each cell, which are
limited to just a few numbers, ie -8888, 0, 100, and 9999. I would like
to display this data with a plot similar to pcolor, but I don't want a
colorbar, I want a legend showing the colors for each code and an
explanation for what each code represents. I would like to be able to
choose a subset of the codes as well, for example just plotting the 0
and 100 codes and ignoring the -8888 and 9999 codes.
I have seen a few similar attempts that used BoundaryNorm, but I don't
want to show a range of values I just want to set colors for a few
explicit values. Those examples also had a colorbar and, as I said, I
would prefer a legend.
Can anyone offer any tips?
For the plot itself you can use pcolor if your data are on a
quadrilateral grid, or a PathCollection or PolyCollection otherwise.
For the legend, you can use proxy artists:
http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
Eric
Thanks
Mat
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Dr. Mathew Topper
Institute for Energy Systems
School of Engineering
The University of Edinburgh
Faraday Building
The King's Buildings
Edinburgh EH9 3JL
Tel: +44 (0)131 650 5570
School fax: +44 (0)131 650 6554
mathew.top...@ed.ac.uk <mailto:mathew.top...@ed.ac.uk>
http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/>
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users