Title: 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: projet...@club-internet.fr
>Copie à: matplotlib-users@lists.sourceforge.net
>
>On Thu, Jan 29, 2009 at 9:19 AM, 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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to