Matplotlib Scatter plot filter color (Colorbar)
I have some data let say x , y , and z . All are 1D arrays. I have done a scatter plot with z as color as; import matplotlib.pyplot as plt plt.scatter(x,y,c=z,alpha = 0.2) plt.xlabel("X") plt.ylabel("Y") plt.ylim((1.2,1.5)) plt.colorbar() The z values are normalized and its between -1 to 1 . I have attached the figure below. The question I have is; How can I filter the colors such that let say the points that have a color value between -0.25 to 0.25 disappear form the figure (i.e set the color to white). The values for x , y , and z can be provided if needed to answer this question. Thank you