0

I want to draw a graph for my school report.

As I should use a marker that has a small dot at center of it, I can't use the default filled circle marker. So I referred to the STIX font table and found that U+2299 satisfies the requirement. However, when I executed the code below, I got a figure in which the line penetrates the plot. How can I hide the line behind these markers so that it won't overlap with them? Any advice would be much appreciated.

values = [i for i in range(3)]
plt.plot(values, values, label="line")
plt.scatter(values, values, marker=u"$\u2299$", s=500, label="marker")
plt.legend()
t0d4
  • 3
  • 3

1 Answers1

1

If I got you right you are looking for something like this:

import matplotlib.pyplot as plt
plt.figure()
values = [i for i in range(3)]
plt.plot(values, values, label="line", zorder=1)
plt.scatter(values, values, s=250, c='w', zorder=2)
plt.scatter(values, values, marker=u"$\u2299$", s=500, label="marker", zorder=3)
plt.legend()

enter image description here

user_na
  • 2,154
  • 1
  • 16
  • 36