11

Is it possible to set the color of the borders of the dots that are generated via the Axes.scatter or is it always black?

thanks!

1 Answer 1

14

If you want to make all the edges the same color:

ax.scatter(...., edgecolor=EC)

where EC is a color. If you want to surpress the edge (so it looks like the edge color matches the face color) use

ax.scatter(..., linewidths=0)

If you want to have the edges be a different color than the face and each marker have it's own color it looks like you have to do the mapping your self:

my_cmap = cm.get_cmap('jet')
my_norm = matplotlib.colors.Normalize()
ec_data = rand(15)
my_normed_data = my_norm(ec_data)
ec_colors = my_cmap(my_normed_data) # a Nx4 array of rgba value
ax.scatter(rand(15), rand(15), s=500, c=rand(15), edgecolors=ec_colors, linewidth=3)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.