[Matplotlib-users] Rasterize FancyArrowPatch etc.?

2013-06-14 Thread Michael McNeil Forbes
I am trying to rasterize the fancy arrows drawn by the lovely streamplot() function, but am running into major problems since the arrows are drawn at a very late stage (to preserve their aspect ratio). -- from pylab import * fig = figure(figsize=(10,5)) x = linspace(-1,1,10)[:, None]

Re: [Matplotlib-users] finding the bounding box of an arbitrary artist

2012-12-29 Thread Michael McNeil Forbes
On 7 Oct 2011, at 4:56 PM, Daniel Hyams wrote: > I'm wanting to highlight the artist under the cursor with a > transparent Rectangle patch. To do this, I have very, roughly, in a > mouse motion handler, > > under = self.figure.hitlist(ev) > if under: >artist = under[0] >bbox = artist.

[Matplotlib-users] Conversion to grayscale for Laser Printing

2012-09-23 Thread Michael McNeil Forbes
Hi Everyone, I am considering the best practices for producing high-quality plots for publication. I would like to be able to use colour and and transparency for screen viewing, but also want to ensure that the graphs print well. The typical problem I run into is using colors for data curves. W

[Matplotlib-users] Rasterized contourf (mixed-mode rendering)?

2011-08-13 Thread Michael McNeil Forbes
Hi, I am trying to figure out how to produce a mixed-mode rendering PDF of a contourf plot. I tried something like this: >>> from pylab import meshgrid, sin, cos, linspace, contourf, savefig, clf >>> x, y = meshgrid(*(linspace(-1,1,500),)*2) >>> z = sin(20*x**2)*cos(30*y) >>> c = contourf(

Re: [Matplotlib-users] Problem with matplotlib 1.0.1 and psfrag (LaTeX)

2011-03-17 Thread Michael McNeil Forbes
On 13 Jan 2011, at 5:50 AM, Michael Droettboom wrote: > Can you provide a simple LaTeX document that illustrates the problem > with psfrag? This is still compliant Postscript, AFAICT. It is not a postscript compliance issue, but rather a requirement of the psfrag package which relys on searc

[Matplotlib-users] How to plot saved plot data in a new figure?

2009-09-18 Thread Michael McNeil Forbes
Hi, Is there a standard way to compute first and then plot something later? For example, I would like to generate a fine contour plot, then use it as a background later. x = np.linspace(-1,1,1000) X,Y = np.meshgrid(x,x) Z = ((X*X + Y*Y) - 0.5)**2 + Y**2 contours = plt.contour(X,Y,Z,100) # T

Re: [Matplotlib-users] saving at a specified size

2009-04-10 Thread Michael McNeil Forbes
On 8 Apr 2009, at 12:29 PM, Gideon Simpson wrote: > Is there a way to save a figured at a specified size? > -gideon I have always specified the figure size first in the figure command: fig_width = 5 # Default unit is inches fig_height = 3 plt.figure(figsize=(fig_width, fig_height)) plt.plot(..

[Matplotlib-users] Limiting scalex/scaley to specific elements.

2009-04-09 Thread Michael McNeil Forbes
Is there a standard way to associate scalex/scaley information with individual plot elements? I would like to do the following: x = linspace(-1,1,100) y = sin(x) plot(x,y) plot(x,10*y,scaley=False) plot(x,2*y) and have it be equivalent to plotting instead in the order plot(x,y) plot(x,2*y) pl

Re: [Matplotlib-users] How to give a name to a figure?

2008-09-15 Thread Michael McNeil Forbes
On Sep 15, 2008, at 4:53 PM, Jae-Joon Lee wrote: > To change the window title, you may use > > fig.canvas.set_window_title("My Title") > > But I couldn't find any public method to obtain the current window > title. Kind of awkward, but fig.canvas.manager.window.wm_title() returns the current

Re: [Matplotlib-users] Axes bg color bug or API change.

2008-08-08 Thread Michael McNeil Forbes
On 8 Aug 2008, at 8:42 PM, Michael McNeil Forbes wrote: > While revisiting some old plotting code, I ran across the following > change in behaviour that seems to be buggy. > > from pylab import * > ion() > clf() > x = linspace(0,1,10) > plot(x,x**2,'r') >

Re: [Matplotlib-users] Autonomous display of image/plot/figure

2008-07-07 Thread Michael McNeil Forbes
Why do you want to "fork" the process? If you just run it in the background it should have the desired effect: from pylab import * x = linspace(-10,10,100) # or load data from a file. y = sin(x) plot(x,y) show() $ python tst.py& Process remains in background running until the user closes th

[Matplotlib-users] Best way to create an inset axes with "shared" scales.

2008-04-17 Thread Michael McNeil Forbes
Hi, I am trying to figure out the best way to create an inset axis on a plot, but where one inset axis shares the same scale as the main axis. Basically, I want something like the inset axes in axes_demo.py, but where the x-axis of the inset axis is aligned and has the same scale as the mai

Re: [Matplotlib-users] overflow and other warnings

2007-11-10 Thread Michael McNeil Forbes
On 10 Nov 2007, at 7:51 AM, Michael V. DePalatis wrote: ... > I recently discovered that if I import > pylab after importing numpy, I get tons of warnings: > > Warning: divide by zero encountered in divide > Warning: invalid value encountered in multiply > Warning: overflow encountered in long_sca

[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