Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e391bc4

Browse files
committed
added another image clippath demo; forgot there was already one in pylab_examples
svn path=/trunk/matplotlib/; revision=6848
1 parent 0ad0ee4 commit e391bc4

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

examples/api/clippath_demo.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
Clipping to arbitrary patches and paths
3+
"""
4+
import numpy as np
5+
import matplotlib.pyplot as plt
6+
import matplotlib.path as path
7+
import matplotlib.patches as patches
8+
9+
10+
fig = plt.figure()
11+
ax = fig.add_subplot(111, frameon=False, xticks=[], yticks=[])
12+
13+
im = ax.imshow(np.random.rand(10,10))
14+
15+
patch = patches.Circle((300,300), radius=100)
16+
im.set_clip_path(patch)
17+
18+
plt.show()
19+
20+

0 commit comments

Comments
 (0)