Re: [Matplotlib-users] removing paths inside polygon

2013-03-22 Thread Andrew Dawson
Thanks, the clipping is working now. But as you say the weird line width
issue still remains for Agg (and png, perhaps that uses Agg, I don't
know...). PDF output looks correct.


On 20 March 2013 05:48, Jae-Joon Lee lee.j.j...@gmail.com wrote:


 On Wed, Mar 13, 2013 at 2:17 AM, Andrew Dawson daw...@atm.ox.ac.ukwrote:

 You should see that the circle is no longer circular, and also there are
 weird line width issues. What I want it basically exactly like the attached
 without_clipping.png but with paths inside the circle removed.


 The reason that circle is no more circle is that simply inverting the
 vertices does not always results in a correctly inverted path.
 Instead of following line.

 interior.vertices = interior.vertices[::-1]

 You should use something like below.

 interior = mpath.Path(np.concatenate([interior.vertices[-2::-1],
   interior.vertices[-1:]]),
   interior.codes)

 It would be good if we have a method to invert a path.

 This will give you a circle. But the weird line width issue remains. This
 seems to be an Agg issue, and the line width seems to depend on the dpi.
 I guess @mdboom nay have some insight on this.

 Regards,

 -JJ




-- 
Dr Andrew Dawson
Atmospheric, Oceanic  Planetary Physics
Clarendon Laboratory
Parks Road
Oxford OX1 3PU, UK
Tel: +44 (0)1865 282438
Email: daw...@atm.ox.ac.uk
Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] removing paths inside polygon

2013-03-22 Thread Michael Droettboom

See https://github.com/matplotlib/matplotlib/pull/1846

On 03/22/2013 11:17 AM, Michael Droettboom wrote:

It's puzzler.  I'm looking at it now.

Mike

On 03/22/2013 06:33 AM, Andrew Dawson wrote:
Thanks, the clipping is working now. But as you say the weird line 
width issue still remains for Agg (and png, perhaps that uses Agg, I 
don't know...). PDF output looks correct.



On 20 March 2013 05:48, Jae-Joon Lee lee.j.j...@gmail.com 
mailto:lee.j.j...@gmail.com wrote:



On Wed, Mar 13, 2013 at 2:17 AM, Andrew Dawson
daw...@atm.ox.ac.uk mailto:daw...@atm.ox.ac.uk wrote:

You should see that the circle is no longer circular, and
also there are weird line width issues. What I want it
basically exactly like the attached without_clipping.png but
with paths inside the circle removed.


The reason that circle is no more circle is that simply inverting
the vertices does not always results in a correctly inverted path.
Instead of following line.

interior.vertices = interior.vertices[::-1]

You should use something like below.

interior = mpath.Path(np.concatenate([interior.vertices[-2::-1],
interior.vertices[-1:]]),
interior.codes)

It would be good if we have a method to invert a path.

This will give you a circle. But the weird line width issue
remains. This seems to be an Agg issue, and the line width seems
to depend on the dpi.
I guess @mdboom nay have some insight on this.

Regards,

-JJ




--
Dr Andrew Dawson
Atmospheric, Oceanic  Planetary Physics
Clarendon Laboratory
Parks Road
Oxford OX1 3PU, UK
Tel: +44 (0)1865 282438
Email: daw...@atm.ox.ac.uk mailto:daw...@atm.ox.ac.uk
Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] removing paths inside polygon

2013-03-19 Thread Jae-Joon Lee
On Wed, Mar 13, 2013 at 2:17 AM, Andrew Dawson daw...@atm.ox.ac.uk wrote:

 You should see that the circle is no longer circular, and also there are
 weird line width issues. What I want it basically exactly like the attached
 without_clipping.png but with paths inside the circle removed.


The reason that circle is no more circle is that simply inverting the
vertices does not always results in a correctly inverted path.
Instead of following line.

interior.vertices = interior.vertices[::-1]

You should use something like below.

interior = mpath.Path(np.concatenate([interior.vertices[-2::-1],
  interior.vertices[-1:]]),
  interior.codes)

It would be good if we have a method to invert a path.

This will give you a circle. But the weird line width issue remains. This
seems to be an Agg issue, and the line width seems to depend on the dpi.
I guess @mdboom nay have some insight on this.

Regards,

-JJ
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] removing paths inside polygon

2013-03-12 Thread Andrew Dawson
Hi

I'd like to be able to clip a line so that the portion of it lying outside
of a given polygon remains visible and the part that lies inside of the
polygon is not visible. What I want is basically the opposite of:

line.set_clip_path(polygon)

which leaves only the part of the line inside the polygon visible. Is this
possible?

I know I can just fill the polygon with the background color or something
but this gets messy when there are other lines on the plot that don't need
to be clipped.

Thanks,
Andrew
--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and remains a good choice in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users