本文整理匯總了Python中matplotlib.patches.CirclePolygon方法的典型用法代碼示例。如果您正苦於以下問題:Python patches.CirclePolygon方法的具體用法?Python patches.CirclePolygon怎麽用?Python patches.CirclePolygon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.patches
的用法示例。
在下文中一共展示了patches.CirclePolygon方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_alpha
# 需要導入模塊: from matplotlib import patches [as 別名]
# 或者: from matplotlib.patches import CirclePolygon [as 別名]
def test_alpha():
# We want an image which has a background color and an
# alpha of 0.4.
fig = plt.figure(figsize=[2, 1])
fig.set_facecolor((0, 1, 0.4))
fig.patch.set_alpha(0.4)
import matplotlib.patches as mpatches
fig.patches.append(mpatches.CirclePolygon([20, 20],
radius=15,
alpha=0.6,
facecolor='red'))
示例2: addCircle
# 需要導入模塊: from matplotlib import patches [as 別名]
# 或者: from matplotlib.patches import CirclePolygon [as 別名]
def addCircle(self, label, x, y, r, color='y', lw=1):
"""Add circle patch at postion (*x*,*y*) with radius *r*
using a line with color *color* and thickness *lw*."""
circ=CirclePolygon((x,y),radius=r,ec=color,zorder=self.zorder,lw=lw,fill=False)
# Add patch to figure
self.addPatch(label,circ)