Friday 14 March 2014

Creating colourmaps enhancing small changes around a centre

Data

The data used for this test is a 2 by 2 matrix made from a sin(x) * sin(y) function plotted on a meshgrid (x and y between -4 and 4). This function has been divided by 10 or 11 on the off diagonal elements, in order to show small variations around 0.

Default colourmap


 

Divergent colourmap

This is the seismic colourmap, which is designed to show bright colours at large values. It does a better job of displaying the data, but it still has some problems


 

My black colourmap

This is my solution to the problem.
I've started with the jet colourmap (could have been any other colourmap) and then added a black part in the centre, which creates a nice contrast in the figure.
In order to not get a nice gradient, the number of colour steps in the map has been increased to 512 compared to the default 256.

Shifting the centre

The method allows for shifting the centre to an arbitrary place, here 0.4


No comments:

Post a Comment