Re: [Matplotlib-users] Clipping a plot inside a polygon

2013-09-03 Thread Phil Elson
Sadly each keyword is handled manually in lib/matplotlib/contour.py L690 which is why you can set keywords which are completely ignored without getting any warning/exception. We could add a set_clip_path keyword in that constructor, but in truth the whole keyword handling approach in contour.py cou

Re: [Matplotlib-users] Clipping a plot inside a polygon

2013-09-02 Thread Alex Goodman
Actually, sorry for the triple post, but is there a reason why we can't do something like pass in the keyword arguments directly from the call to contourf when instantiating each collection? Then the keyword arguments for contourf (and ContourSet) could be used for the collections directly, includi

Re: [Matplotlib-users] Clipping a plot inside a polygon

2013-09-02 Thread Alex Goodman
Actually, it seems I have partially answered my own question. Since I am calling axis('off'), I do not notice the effect of clipping the other artists since I made a call to axis('off'). Without it the spines and axes rectangle are still removed but the ticks are still visible. I suppose this is fi

Re: [Matplotlib-users] Clipping a plot inside a polygon

2013-09-02 Thread Alex Goodman
Hi Phil, Thanks, that is more or less what I was looking for. However, I still think that generalizing this approach for other types of plotting functions that don't return artists directly would be useful. Your solution gave me another idea for doing this, which would be to iterate through all of

Re: [Matplotlib-users] Clipping a plot inside a polygon

2013-09-02 Thread Phil Elson
Great question. The contour set itself does not have a set_clip_path method but you can iterate over each of the contour collections and set their respective clip paths, i.e.: cs = plt.contourf(data) for collection in cs.collections: collection.set_clip_path(poly) Of course, you can use this

[Matplotlib-users] Clipping a plot inside a polygon

2013-09-01 Thread Alex Goodman
Hi all, I want to be able to plot data on maps (using basemap or cartopy) inside specific regions, eg a single state, province or country. A similar question was asked a long time ago on the mailing list and the suggested solution back then was to read the bounding polygon from a shapefile and the

Re: [Matplotlib-users] Clipping Contours

2012-10-18 Thread Jae-Joon Lee
On Tue, Oct 16, 2012 at 4:04 PM, T J wrote: > I'm interested in clipping the result of plt.contour (and > plt.contourf) to a patch. However, QuadContourSet does not have a > set_clip_path() method. Is there a way to do this? QuadContourSet does not (I think it should), but LineCollection instan

Re: [Matplotlib-users] Clipping Contours

2012-10-17 Thread Ian Thomas
On 16 October 2012 18:44, T J wrote: > > This is a set of 152 points on a triangle. delaunay is mentioned to > have problems for some pathological cases. Is a complete triangular > grid considered as such a case? > Yes, under certain circumstances! delaunay is not 'geometrically robust', mean

Re: [Matplotlib-users] Clipping Contours

2012-10-16 Thread T J
On Tue, Oct 16, 2012 at 2:34 AM, Damon McDougall wrote: > On Tue, Oct 16, 2012 at 8:04 AM, T J wrote: >> I'm interested in clipping the result of plt.contour (and >> plt.contourf) to a patch. However, QuadContourSet does not have a >> set_clip_path() method. Is there a way to do this? >> >> Her

Re: [Matplotlib-users] Clipping Contours

2012-10-16 Thread Damon McDougall
On Tue, Oct 16, 2012 at 8:04 AM, T J wrote: > I'm interested in clipping the result of plt.contour (and > plt.contourf) to a patch. However, QuadContourSet does not have a > set_clip_path() method. Is there a way to do this? > > Here is an example plot that I have generated. > >http://imgur.

[Matplotlib-users] Clipping Contours

2012-10-16 Thread T J
I'm interested in clipping the result of plt.contour (and plt.contourf) to a patch. However, QuadContourSet does not have a set_clip_path() method. Is there a way to do this? Here is an example plot that I have generated. http://imgur.com/pybIf For the curious, it plots contours of a functi

Re: [Matplotlib-users] Clipping

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 10:11 AM, Michael Droettboom wrote: > The coordinates for Circle (and all patches) are in data coordinates. > So the (300, 300) is relative to the values in the data itself.  When > adding a patch directly to a plot, however, the limits may not > automatically update, so yo

Re: [Matplotlib-users] Clipping

2010-02-22 Thread Michael Droettboom
The coordinates for Circle (and all patches) are in data coordinates. So the (300, 300) is relative to the values in the data itself. When adding a patch directly to a plot, however, the limits may not automatically update, so you may need to call axes.set_xlim or axes.set_ylim to adjust them

Re: [Matplotlib-users] Clipping

2010-02-18 Thread Ryan May
On Wed, Feb 17, 2010 at 6:44 PM, David Arnold wrote: > All, > > I'm looking at: > > http://matplotlib.sourceforge.net/examples/api/clippath_demo.html > > But I cannot figure out: > > patch=patches.Circle((300, 300), radius=100) > > Where precisely is (300,300)? I believe it's in window coordinate

[Matplotlib-users] Clipping

2010-02-17 Thread David Arnold
All, I'm looking at: http://matplotlib.sourceforge.net/examples/api/clippath_demo.html But I cannot figure out: patch=patches.Circle((300, 300), radius=100) Where precisely is (300,300)? D. -- Download Intel® Paralle

Re: [Matplotlib-users] clipping and linewidth/circle radius

2009-09-02 Thread jason-sage
Michael Droettboom wrote: > jason-s...@creativetrax.com wrote: >> I'm trying to deal nicely with the clipping that happens when, for >> example, a line has data that is inside its clipping box, but the >> linewidth forces part of the line to be drawn outside of the clipping >> box. This is visi

Re: [Matplotlib-users] clipping and linewidth/circle radius

2009-09-02 Thread Michael Droettboom
jason-s...@creativetrax.com wrote: > I'm trying to deal nicely with the clipping that happens when, for > example, a line has data that is inside its clipping box, but the > linewidth forces part of the line to be drawn outside of the clipping > box. This is visible on the spine placement demo

[Matplotlib-users] clipping and linewidth/circle radius

2009-09-01 Thread jason-sage
I'm trying to deal nicely with the clipping that happens when, for example, a line has data that is inside its clipping box, but the linewidth forces part of the line to be drawn outside of the clipping box. This is visible on the spine placement demo at http://matplotlib.sourceforge.net/exam

Re: [Matplotlib-users] Clipping the bottom labels

2006-06-23 Thread John Hunter
> "Ryan" == Ryan Krauss <[EMAIL PROTECTED]> writes: Ryan> I have a similar problem because I use bigfonts. If you are Ryan> going to make a lot of these plots, you can change the Ryan> default for left, bottom, height, and width in your Ryan> matplotlibrc file. Look for the l

Re: [Matplotlib-users] Clipping the bottom labels

2006-06-23 Thread Ryan Krauss
I have a similar problem because I use bigfonts. If you are going to make a lot of these plots, you can change the default for left, bottom, height, and width in your matplotlibrc file. Look for the lines: figure.subplot.left : 0.15 #0.125 # the left side of the subplots of the figure figure.s

Re: [Matplotlib-users] Clipping the bottom labels

2006-06-23 Thread ddlucas
On Friday 23 June 2006 8:12 pm, Johan Fredrik Øhman wrote: > Hi, > > I made a plot where the values on the X-axis are dates, "JUN, JUL, > AUG.. etc ". To make them fit better, I have rotated the text using > setp(labels, rotation=45, size=8), the problem is that the text is > "clipped" in bottom.

[Matplotlib-users] Clipping the bottom labels

2006-06-23 Thread Johan Fredrik Øhman
Hi, I made a plot where the values on the X-axis are dates, "JUN, JUL, AUG.. etc ". To make them fit better, I have rotated the text using setp(labels, rotation=45, size=8), the problem is that the text is "clipped" in bottom. How can I expand the boundries? Thanks !! figure(num=1, figsize=(2,2

Re: [Matplotlib-users] Clipping of axes frame rectangle.

2006-05-30 Thread ddlucas
On Friday 26 May 2006 11:08 am, Michael McNeil Forbes wrote: > I am having some problems with the axes frame being clipped. > > > Consider the following: > > from pylab import * > fill([0,1,1,0],[0,0,1,1],facecolor=(1,1,1),edgecolor=(1,1,1)) > axis([-1,1,-1,1]) > gca().get_frame().set_linewidth(20)

[Matplotlib-users] Clipping of axes frame rectangle.

2006-05-30 Thread Michael McNeil Forbes
I am having some problems with the axes frame being clipped. Consider the following: from pylab import * fill([0,1,1,0],[0,0,1,1],facecolor=(1,1,1),edgecolor=(1,1,1)) axis([-1,1,-1,1]) gca().get_frame().set_linewidth(20) show() I have made the frame thick to emphasize the problem: When I plot