Set two colors for a point of a matplotlib-scatter plot

Question:

So Realising that this may not possible. What I want to do, looks something like this:

point_x = [1]
point_y = [1]

col1 =    ['blue']
col2 =    ['red']

plt.scatter(point_x,point_y, c=col1,marker='o')
plt.scatter(point_x,point_y, c=col2,marker=donut?)

This would represent one point, where a portion of the (let’s say) sphere, is color1, and a portion of (probably) a donut around the center of sphere, is color2.

Has anyone tried this?

Asked By: Billy Matlock

||

Answers:

maybe specifiying the point size s would help

from matplotlib import pyplot as plt

point_x = 1
point_y = 1

col1 = ['blue']
col2 = ['red']

plt.scatter(point_x, point_y, c=col1, marker='o', s=1000)
plt.scatter(point_x, point_y, c=col2, marker='o', s=500)
plt.show()

output

enter image description here

Answered By: AlexWach
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.