from matplotlib.patches import Wedge
from matplotlib.collections import PatchCollection
from matplotlib.ticker import MultipleLocator
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
y,r,b = '#f5a252', '#e66581' ,'#579aca'
patches = [
Wedge((13 , 12+4), 5, 0, 360, width=2), #yellow
Wedge((13-4, 12 ), 5, 0, 360, width=2), # red
Wedge((13 , 12-4), 5, 0, 360, width=2), # blue,
Wedge((13 , 12+4), 5, 180-25, 180+25, width=2), # yellow patch above
Wedge((13-4, 12 ), 5, 270-25, 270+25, width=2), # red patch above
]
for uaxis in [ax.xaxis, ax.yaxis]:
uaxis.set_major_locator(MultipleLocator(4))
uaxis.set_minor_locator(MultipleLocator(1))
plt.grid(which='both', alpha=0.4)
colors = [y,r,b,y,r]
for w,c in zip(patches, colors):
p = PatchCollection([w])
p.set_color(c)
ax.add_collection(p)
plt.axis('equal')
ax.set_xlim(0,24)
ax.set_ylim(0,24)
fig.set_figwidth(10)
fig.set_figheight(10)
plt.show()