X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions galleries/examples/misc/demo_agg_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,19 @@ def drop_shadow_patches(ax):
def light_filter_pie(ax):
fracs = [15, 30, 45, 10]
explode = (0.1, 0.2, 0.1, 0.1)
pies = ax.pie(fracs, explode=explode)
pie = ax.pie(fracs, explode=explode)

light_filter = LightFilter(9)
for p in pies[0]:
for p in pie.wedges:
p.set_agg_filter(light_filter)
p.set_rasterized(True) # to support mixed-mode renderers
p.set(ec="none",
lw=2)

gauss = DropShadowFilter(9, offsets=(3, -4), alpha=0.7)
shadow = FilteredArtistList(pies[0], gauss)
shadow = FilteredArtistList(pie.wedges, gauss)
ax.add_artist(shadow)
shadow.set_zorder(pies[0][0].get_zorder() - 0.1)
shadow.set_zorder(pie.wedges[0].get_zorder() - 0.1)


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions galleries/examples/pie_and_polar_charts/bar_of_pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
explode = [0.1, 0, 0]
# rotate so that first wedge is split by the x-axis
angle = -180 * overall_ratios[0]
wedges, *_ = ax1.pie(overall_ratios, autopct='%1.1f%%', startangle=angle,
labels=labels, explode=explode)
pie = ax1.pie(overall_ratios, autopct='%1.1f%%', startangle=angle,
labels=labels, explode=explode)

# bar chart parameters
age_ratios = [.33, .54, .07, .06]
Expand All @@ -47,8 +47,8 @@
ax2.set_xlim(- 2.5 * width, 2.5 * width)

# use ConnectionPatch to draw lines between the two plots
theta1, theta2 = wedges[0].theta1, wedges[0].theta2
center, r = wedges[0].center, wedges[0].r
theta1, theta2 = pie.wedges[0].theta1, pie.wedges[0].theta2
center, r = pie.wedges[0].center, pie.wedges[0].r
bar_height = sum(age_ratios)

# draw top connecting line
Expand Down
X Tutup