Add Colorbar To Scatterplot With Non-filled Circles
I cannot get the pyplot colorbar to cooperate in a scatter where I specifically set facecolors=None and only want to display the edge of the scattered circles. Could someone please
Solution 1:
I think you can trick the system by creating a "normal" scatterplot using the c=
argument to seed the colorbar. Then, in a second step, remove the facecolor to leave only the edges.
x = np.random.random(size=(100,))
y = np.random.random(size=(100,))
c = np.random.random(size=(100,))
fig, ax = plt.subplots()
g = ax.scatter(x, y, marker='o', c=c)
g.set_facecolor('none')
fig.colorbar(g)
Post a Comment for "Add Colorbar To Scatterplot With Non-filled Circles"