Thanks for the suggestions, I have tried the easiest one for now, namely pcolormesh, see attached plot. The alpha colormap look great but I can't seem to figure out how to prevent the edges of the cells from being visible. I tried using edgecolors='none' to no avail. I guess retrospectively that is similar to the lines we see in the colormap on the right.

The snippet I am using:

import numpy as np

import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap

import matplotlib

matplotlib.rcParams['figure.facecolor'] = 'white'

cm_dict = {'red':  ((0.0, 1.0, 1.0),
                    (1.0, 1.0, 1.0)),
           'green': ((0.0, 0.0, 0.0),
                     (1.0, 0.0, 0.0)),
           'blue':  ((0.0, 0.0, 0.0),
                     (1.0, 0.0, 0.0)),
           'alpha': ((0.0, 0.0, 0.0),
                     (1.0, 1.0, 1.0))
          }

my_cm = LinearSegmentedColormap('my_cm', cm_dict)

vals = np.tile(np.linspace(-1, 1, 30), (20, 1))

fig = plt.figure()
ax = plt.pcolormesh(vals, cmap=my_cm)
plt.colorbar()
plt.show()

Cheers,
Loïc
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to