Using colours for x-axis and y-axis on scatter plot

RE: Bar Plots And Scatter Plots

Does anyone know what code should I use to apply different colours for data representing x-axis and y-axis on scatter plots?

Hi Nick,

Please check this StackOverflow post.

Hi @NickKobets,

Here is a list of all the Matplotlib colors that you can use:

I believe you set it using the following syntax:

plt.scatter(x, y, color='darkolivegreen')

Thank you for your response. But that is not what I meant. I would like to differentiate the dots representing x-axis from those representing y-axis on scatter plot. For example red for y-axis and blue for x-axis.

Thank you, but I can’t find anything there related to scatter plot.

Probably I didn’t understand your question, but each point on a scatter plot is represented by both x and y. Could you please clarify what you mean by representing x-axis and y-axis?

Hi Elena

Thank you. I just realised that I misunderstood how scatter plot is being used in this instance. It is all clear now.

1 Like

Hi Nick, great that you’ve managed to resolve it!