Flashmail
Thanks, your example works but what I must do so to plot for example y=cos x ? I’m a very beginner.
Christophe.
----Message d’origine----
Date: Thu, 29 Jan 2009 09:34:11 -0600
Sujet: Re: [Matplotlib-users] Plot only inside a disc
De: John Hunter
A: projetmbc@…748…
Copie à: matplotlib-users@lists.sourceforge.netHello,
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
···
On Thu, Jan 29, 2009 at 9:19 AM, wrote:
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()