# Drawing ellipse with shapely?

How do I draw an ellipse with `shapely`?

First, define a circle of radius 1.
Then define an ellipse along x and y axis.
Finally rotate the ellipse.
EDIT: Finally, actually draw the ellipse

### Code:

EDIT: previous code defined ellipse but didn't actually draw anything as asked

``````from matplotlib import pyplot
from shapely.geometry.point import Point
import shapely.affinity
from descartes import PolygonPatch
# Note: download figures.py manually from shapely github repo, put it in shapely install directory
from shapely.figures import SIZE, GREEN, GRAY, set_limits

# 1st elem = center point (x,y) coordinates
# 2nd elem = the two semi-axis values (along x, along y)
# 3rd elem = angle in degrees between x-axis of the Cartesian base
#            and the corresponding semi-axis
ellipse = ((0, 0),(7, 4),36)

# Let create a circle of radius 1 around center point:
circ = shapely.geometry.Point(ellipse).buffer(1)

# Let create the ellipse along x and y:
ell  = shapely.affinity.scale(circ, int(ellipse), int(ellipse))

# Let rotate the ellipse (clockwise, x axis pointing right):
ellr = shapely.affinity.rotate(ell,ellipse)

# If one need to rotate it clockwise along an upward pointing x axis:
elrv = shapely.affinity.rotate(ell,90-ellipse)
# According to the man, a positive value means a anti-clockwise angle,
# and a negative one a clockwise angle.

fig = pyplot.figure()
Result of `elrv`: 