I just discovered pyplot.scatter and have been playing with it a bit. I’m having trouble interpreting my results due to the coloring. For example, given my 3 (a,b) sized data arrays dataX, dataY, and dataMag:
import pyplot as plt
import numpy as np
plt.scatter(x=dataX.flat, y=dataY.flat, vmin=np.min(dataMag),
vmax=np.max(dataMag), c=dataMag.flat, lw=1, s=1)
plt.show()
It would be really helpful if there was a way to set the low values in dataMag (i.e. 0) to white and have the colors gradually increase to the maximum color of black, or red, or whatever i don’t care. Is there a way to do this?
Thanks in advance!
I think you are looking for the kwarg
cmap.Taken from the scipy cookbook:
well generate a figure with all the color maps available with your installation. The name with ‘_r’ appeded on the end will give you the same map, with the colors in the opposite direction.
It is also possible to define your own custom color maps