0

I am currently working on a project that deals with a scatter plot, made using matplotlib and numpy, I was wondering whether I could assign color to each point based on their (x,y) coordinates, assume that I have a function that maps (x,y) to (r,g,b). There are a lot of points (~250,000).

Is there any possible way to achieve this?

Hrsht
  • 129
  • 1
  • 6

1 Answers1

0

Matplotlib's scatter plot supports this via the color parameter, check this example. You have to prepare your colors beforehand and pass it to the color. As mentioned, color can be a sequence.

Another way, maybe slightly faster, would be to use seaborn's scatter plot.

Amir
  • 1,087
  • 1
  • 9
  • 26