A ScalarMappable consists of a colormap, a normalization and an array of values. This process happens internally in scatter if an array of numeric values is provided to c.Ī scatter creates a PathCollection, which subclasses ScalarMappable. Here the value of 4 would be mapped to 0 by the normalzation, and the value of 5 be mapped to 1, such that the colormap provides the two outmost colors. The natural way to obtain a color from some data is hence to chain the two, cmap = plt.cm.Spectral The usual case of Normalize would provide a linear mapping of values between vmin and vmax to the range between 0.
0 Comments
Leave a Reply. |