I have attached a figure (colorBarExample.png) that I hope everybody can see. The figure is for data from a model whose gridbox size is a function of time and space. I have done a color fill using a color map (jet) and a normalization. I use a collection of patches, each patch defines a polygon of the vertices of the gridbox and a color indexed to the value in that gridbox. I have to modify the call to the colorbar so that it accepts this colormap and normalization. For values outside the range of the max and min of the normalization, I have added filled triangles above and below the color bar. This type of display is found in other visualization software. It allows the scale to just consider values of interest, while providing information as to the location and relative values of outliers. I have also modified the colorbar code( in figure.py) to scale the width of the colorbar. I generate plots with aspect ratios of x axis long with respect to the y axis and in this situation the colorbar gets to be too fat. The purpose of this long winded message is to advocate that the color bar code be modified to make this facility an option( ie specified color map, normalization, width scaling and end caps). I am willing to do this myself - but I would need some help. Previously, John suggested that I make the routine that does the fill calls derive from ScalarMappable. This would make the colorbar color map and scaling come along naturally. My skill level is such that I have not been able to get this to work - I am willing but not very able. My thought now is to make some substantial additions to colorbar. --Jim \
James Boyle writes: [snip] > For values outside the range of the max and min of the normalization, I > have added filled triangles above and below the color bar. > This type of display is found in other visualization software. It > allows the scale to just consider values of interest, while providing > information as to the location and relative values of outliers. I'd also find this very useful. For comparison, there is something similar (colorscale) on the matlab central file exchange: http://tinyurl.com/8yzbe but it looks like it was broken in the change from R13 to R14. Not that I can be of any use adding this, but colorscale also has a nice feature that: "The colormap may contain special values for null data areas, and these special values may be excluded from the scale bar. Or, the colormap may be deliberately partitioned and shared with a different image in the same figure, and that image may have its own, entirely distinct, color scale." There's a nice walkthrough here: http://www.mathworks.com/company/newsletters/digest/nov02/earth.html Regards, Phil
>>>>> "James" == James Boyle <bo...@ll...> writes: James> I have also modified the colorbar code( in figure.py) to James> scale the width of the colorbar. I generate plots with James> aspect ratios of x axis long with respect to the y axis and James> in this situation the colorbar gets to be too fat. The current implementation supports providing a custom axes for the colorbar axes. Do you think it would be useful in addition to support something like a fracw (fraction width) keyword arg for the default width of the colorbar when making an automatic colorbar axes. If so we should support this for vertical colorbars as well. Something like fracax=0.1, the fraction of the axis (x for horizontal or y for vertical colorbars) taken up by the colorbar when automatically resizing the image axes. James> The purpose of this long winded message is to advocate that James> the color bar code be modified to make this facility an James> option( ie specified color map, normalization, width James> scaling and end caps). James> I am willing to do this myself - but I would need some James> help. Previously, John suggested that I make the routine James> that does the fill calls derive from ScalarMappable. This James> would make the colorbar color map and scaling come along James> naturally. My skill level is such that I have not been able James> to get this to work - I am willing but not very able. My James> thought now is to make some substantial additions to James> colorbar. All of this sounds fine to me -- let me know how I can help. JDH