1

When a plot overlapping occurs I would like to obtain the RGB sum of the colors instead of simply painting over the existing plot.

from matplotlib import pyplot as plt
%matplotlib inline

plt.scatter(0,1,s=1000,c='g')
plt.scatter(1,1,s=1000,c='g')
plt.scatter(1,1.01,s=1000,c='r')
plt.scatter(1,1.1,s=1000,c='g')
plt.scatter(2,1,s=1000,c='g')

This generates the following image: enter image description here

But I would like to obtain the mathematical sum of the colors (255,0,0) + (0,255,0) = (255, 255, 0)

So like this: enter image description here

I tried with the alpha parametter but it depends on which plot was first.

room13
  • 883
  • 2
  • 10
  • 26
  • Alpha should work if both markers have alpha that is the same – Jody Klymak Jan 13 '20 at 15:19
  • I already tried it and it depends on which plot was plotted first @jody-klymak – room13 Jan 13 '20 at 16:04
  • 1
    This isn't really in the scope of matplotib because it would change based on your marker size. It sounds like you should define some spatial geometries and represent the areas and compute the intersections and symbolize the resulting geometries accordingly – Paul H Jan 13 '20 at 17:15
  • I'm not sure if you have a different problem this relates to, but you don't have physical data between those intersections of those points so you can't condition the geometry to change the color. I believe using 'alpha' is your only option but it won't add RBG values. – BenT Jan 13 '20 at 17:22

0 Answers0