本文整理汇总了Python中matplotlib.patches.Shadow.set_zorder方法的典型用法代码示例。如果您正苦于以下问题:Python Shadow.set_zorder方法的具体用法?Python Shadow.set_zorder怎么用?Python Shadow.set_zorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.patches.Shadow
的用法示例。
在下文中一共展示了Shadow.set_zorder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Shadow
# 需要导入模块: from matplotlib.patches import Shadow [as 别名]
# 或者: from matplotlib.patches.Shadow import set_zorder [as 别名]
# We want to draw the shadow for each pie but we will not use "shadow"
# option as it does'n save the references to the shadow patches.
pies = ax.pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%')
for w in pies[0]:
# set the id with the label.
w.set_gid(w.get_label())
# we don't want to draw the edge of the pie
w.set_ec("none")
for w in pies[0]:
# create shadow patch
s = Shadow(w, -0.01, -0.01)
s.set_gid(w.get_gid()+"_shadow")
s.set_zorder(w.get_zorder() - 0.1)
ax.add_patch(s)
# save
from StringIO import StringIO
f = StringIO()
plt.savefig(f, format="svg")
import xml.etree.cElementTree as ET
# filter definition for shadow using a gaussian blur
# and lighteneing effect.
# The lightnening filter is copied from http://www.w3.org/TR/SVG/filters.html