On Thu, Jan 29, 2009 at 9:19 AM, <[email protected]> wrote:
> Hello,
> I would like to make a kind of magnifying glass. So I need to have a piece of
> a graph and I would like it to have the form of a disc rather than of a box.
> So is-it possible to only draw in a disc (I'm searching for a fast way to do
> that) ?
You can turn off the rendering of the normal axes and axis, and clip
your data to an arbitrary patch or path; eg
"""
Clipping to arbitrary patches and paths
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.path as path
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111, frameon=False, xticks=[], yticks=[])
im = ax.imshow(np.random.rand(10,10))
patch = patches.Circle((300,300), radius=100)
im.set_clip_path(patch)
plt.show()
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users