2013-06-25 74 views

回答

8

使用Wedge Artist

enter image description here

如下:

import matplotlib 
from matplotlib.patches import Wedge 
import matplotlib.pyplot as plt 

fig=plt.figure() 
ax=fig.add_subplot(111) 

fov = Wedge((.2,.2), 0.6, 30, 60, color="r", alpha=0.5) 

ax.add_artist(fov) 

plt.show() 
0
import matplotlib.pyplot as plt 
import matplotlib.patches as patches 
fig1 = plt.figure() 
ax1 = fig1.add_subplot(111, aspect='equal') 
ax1.add_patch(
    patches.Wedge(
     (0, 0),   # (x,y) 
     200,   # radius 
     60,    # theta1 (in degrees) 
     120,   # theta2 
     color="g", alpha=0.2 
    ) 
) 

plt.axis([-150, 150, 0, 250]) 

plt.show()