http://blog.csdn.net/pipisorry/article/details/40005163
1. Call the package function to draw the circle circle and Ellipse ellipse
#################################### !/usr/bin/env python# coding=utf-8# __author__ = ' pipi ' # CTime 2014.10.11# draw Oval and round ################################## #from matplotlib.patches import Ellipse, Circleimport Matplotlib.pyplot as Pltfig = plt.figure () ax = Fig.add_subplot (111) ell1 = Ellipse (xy = (0.0, 0.0), width = 4, Height = 8, angle = 30.0, facecolor= ' yellow ', alpha=0.3) Cir1 = Circle (xy = (0.0, 0.0), radius=2, alpha=0.5) Ax.add_patch ( ELL1) Ax.add_patch (cir1) x, y = 0, 0ax.plot (x, y, ' ro ') plt.axis (' scaled ') # Ax.set_xlim ( -4, 4) # Ax.set_ylim ( -4, 4) Plt.axis ( ' Equal ') #changes limits of x or Y axis so, equal increments of x and Y have the same lengthplt.show ()
See matplotlib.pdf Release 1.3.1 Documentation
p187
18.7 ellipses (see ARC)
p631
Class Matplotlib.patches. Ellipse (xy, width, height, angle=0.0, **kwargs)
Bases:matplotlib.patches.Patch
A scale-free ellipse.
XY Center of Ellipse
Width total length (diameter) of horizontal axis
Height total length (diameter) of vertical axis
Angle rotation in degrees (anti-clockwise)
p626
Class Matplotlib.patches. Circle (XY, radius=5, **kwargs)
or see matplotlib.pdf Release 1.3.1 Document Contour Draw a circle
#coding =utf-8import NumPy as Npimport matplotlib.pyplot as Pltx = y = Np.arange ( -4, 4, 0.1) x, y = Np.meshgrid (x, y) plt.cont Our (x, y, x**2 + y**2, [9]) #x **2 + y**2 = 9 round plt.axis (' scaled ') plt.show ()
p478
Axes3d.
Contour(X, Y, Z, *args, **kwargs)
Create a 3D contour plot.
Argument Description
X, Y, Data values as Numpy.arrays
Z
Extend3d
Stride
Zdir
Offset
Whether to extend contour in 3D (default:false)
Stride (step size) for extending contour
The direction to use:x, Y or Z (default)
If specified plot a projection of the contour lines on this position in plane normal to Zdir
The positional and other
p1025
Matplotlib.pyplot. Axis (*v, **kwargs)
Convenience method to get or set axis properties.
or see Demo
"Pylab_examples Example code:ellipse_demo.py"
2. Direct drawing
from:http://blog.csdn.net/pipisorry/article/details/40005163
ref:http://www.zhihu.com/question/25273956/answer/30466961?group_id=897309766#comment-61590570
How Python Draws a circle