I have a chart with 4 elements: blue square,blue triangle, red square and red triangle, I'm tryng to add these 4 items to the legend. when I add a polygon patch to the legend, it is displayed as a rectangle, even though the patch is of a triangle How can I get it to work?
legend_elements = [patches.RegularPolygon((4, 4), 3, 0.5, np.pi / 4,label="Triangle")]
plt.legend(handles=legend_elements)
