python - How to draw a 2-D graph with 3-D data (x, y and z arrays given) with color coded Z axes representation in Matplotlib? -


i have plain 3-d co-ordinates - set of (x,y,z). want 2-d plot of x vs y coordinates having larger value of z colored darker smaller values of z. how do that?

from description, sounds want scatter.

for example:

import numpy np import matplotlib.pyplot plt  x, y, z = np.random.random((3, 10))  fig, ax = plt.subplots() scat = ax.scatter(x, y, c=z, s=200, cmap='gray_r') fig.colorbar(scat) plt.show() 

enter image description here


Comments