I am trying to visualize some complex data which basically consists of a cloud of points each with a specific value between 0 and 1. This value should be expressed by the color of the scatter plot. As I am using the CMRmap
colormap which is nicely readable on a black and white printout, the white points disappear in front of the white background.(Alternatively I could define lines around each point, but I do like the plot better without.)
In order to be able to see the highest value points, I tried using only the lower part of the colormap, e.g.:
import numpy as np
from matplotlib import pyplot as plt
cmap = plt.get_cmap('CMRmap')
x = np.random.random(1000)
y = np.random.random(1000)
data = np.random.random(1000)
plt.scatter(x, y, marker='.', lw=0, c=data, s=100, cmap=cmap)
plt.colorbar()
plt.clim(0,1.2)
plt.show()
But the colorbar now goes up to the new highest value of 1.2. Is there an easy way to keep the colors of the points as in the example above and use the colorbar from black=0 to yellow=1? Thanks for your comments.