Automatic selection of different colormaps for anomaly & intensity data

Hi,
I’ve been following the discussions about the new default colormaps.

I think it might be really helpful if the default behaviour were that matplotlib simply examined your data (Z, say), and if

(1) Z.max() & Z.min() had the same sign then used a sequential colormap

whereas if

(2) Z.max() & Z.min() had opposite signs then it used a diverging colormap, centered on zero.

Keywords e.g. Anomaly=True & centre = 10. could be extra arguments to override this behaviour.

I realise that

a) this really only requires a user to write a simple helper application.

But 99% of users will never do this.

b) it may not always be desired; but again 99% of the time it probably is.

This would enable people just starting to use matplotlib perhaps to see that it can give ‘better’ plots than matlab

Anyway, just a thought.

George Nurser.

This has been discussed and the consensus was that getting the heuristics right is probably impossible (I work with dark-current subtracted image data so it can have negative values, but using a diverging color map is very wrong, taking 0 as the center only makes sense some of the time). Defaulting to a linear norm and sequential color map is in the worst case not helpful, where as using the wrong center (or incorrectly using a diverging color map) can be misleading. We are prioritizing not being misleading over being slightly more convenient in the core library.

A function with a call signature like you describe should definitely be in the examples.

Also see PR https://github.com/matplotlib/matplotlib/pull/3858 which is adding a new normalizer to make setting up non-symmetric diverging color maps easier.

Tom

···

On Thu, Jul 2, 2015 at 11:49 AM George Nurser <gnurser@…287…> wrote:

Hi,
I’ve been following the discussions about the new default colormaps.

I think it might be really helpful if the default behaviour were that matplotlib simply examined your data (Z, say), and if

(1) Z.max() & Z.min() had the same sign then used a sequential colormap

whereas if

(2) Z.max() & Z.min() had opposite signs then it used a diverging colormap, centered on zero.

Keywords e.g. Anomaly=True & centre = 10. could be extra arguments to override this behaviour.

I realise that

a) this really only requires a user to write a simple helper application.

But 99% of users will never do this.

b) it may not always be desired; but again 99% of the time it probably is.

This would enable people just starting to use matplotlib perhaps to see that it can give ‘better’ plots than matlab

Anyway, just a thought.

George Nurser.


Don’t Limit Your Business. Reach for the Cloud.

GigeNET’s Cloud Solutions provide you with the tools and support that

you need to offload your IT needs and focus on growing your business.

Configured For All Businesses. Start Your Cloud Today.

https://www.gigenetcloud.com/_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users