firefly
firefly

Reputation: 993

Making a logarithmic scaled color plot including negative values

I have a surface density map in matplotlib for which I want the scale of the colorbar to be logarithmic.

Ideally using the LogNorm function should do the trick, but there are negative and null values, which gives an error when the values are turned logarithmic.
Is there function/method that I can use to include the areas with negative and null values in this respect?

Upvotes: 3

Views: 5294

Answers (1)

Sombuddha Bagchi
Sombuddha Bagchi

Reputation: 31

Use symmetric logarithmic normalization or the SymLogNorm to plot data with both positive and negative values. Look at this documentation: Colormap Normalization.

Upvotes: 3

Related Questions