You can plot a circle of specific size at a given point using
import matplotlib.pyplot as plt
circle=plt.Circle((0,0),.2,color='r')
plt.add_artist(circle)
The format is Circle(x, y), radius)
where x
and y
are the position of the center in the plot. See this question for more detail and explanation.
A rectangle (or square) of given size with
import matplotlib.pyplot as plt
import matplotlib.patches as patches
rect = patches.Rectangle((50,100),40,30,facecolor='none')
plt.gca().add_patch(rect)
The format is Rectangle((x, y), w, h)
where x
and y
are the coordinates in the plot of the top-left corner, w
is the width and h
is the height.
You can make an arbitrary polygon (i.e. a star) using
import matplotlib.pyplot as plt
import matplotlib.patches as patches
poly = patches.Polygon(points, facecolor='None')
plt.gca().add_patch(poly)
Where points
is an numpy
array of shape Nx2
(where N
is the number of points) of the vertices of the polygon. More information (including keyword arguments) is available on the matplotlib docs for polygon and rectangle. I you just want those symbols as markers you can simply do
plt.scatter(x, y, marker='*')
Where x
and y
are arrays or array-like of the coordinates at which you want the markers. The marker used can be specified according to the matplotlib markers docs. You can also draw a custom marker by supplying a path
to draw, similar to how the polygon
is drawn.