Skip to content
Advertisement

How to have a poligon in the legend

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?

JavaScript

Advertisement

Answer

You could use line markers to indicate the polygons:

JavaScript

matplotlib legend with squares and triangles

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement