## [Matplotlib-users] Fw: canvas.print_figure printing a variable amount of my figure

 [Matplotlib-users] Fw: canvas.print_figure printing a variable amount of my figure From: David Goldsmith - 2008-09-30 21:20:40 ```I sent the below - with referenced attachments - about 24 hours ago and have yet to see it posted - was it blocked due to the attachments? DG --- On Mon, 9/29/08, David Goldsmith wrote: > From: David Goldsmith > Subject: canvas.print_figure printing a variable amount of my figure > To: matplotlib-users@... > Date: Monday, September 29, 2008, 5:59 PM > I feel like I must be missing something: below is some > "minimal sample" code which reproduces a > "problem" I'm seeing in a more complicated > situation: > > import matplotlib as MPL > from matplotlib.backends.backend_agg import FigureCanvasAgg > as FigureCanvas > from matplotlib.figure import Figure > > for DPI in range(100,201,25): > fig = Figure(figsize=(12,9), > dpi=DPI, > frameon=False) > canvas = FigureCanvas(fig) > > nx, ny = (N.uint16(12*DPI), N.uint16(9*DPI)) > temp = N.indices((ny, nx), N.uint8) > result = N.zeros_like(temp[0]) > result[:ny/2,:] = temp[0,:ny/2,:] + temp[1,:ny/2,:] > result[ny/2:,:] = temp[0,ny/2:,:] - temp[1,ny/2:,:] > fig.figimage(result/N.float(N.max(result))) > > canvas.print_figure("test"+str(DPI)+"dpi.png") > > Attached are the results on my computer (see usage details > below). Granted, I'm increasing the resolution each > iteration, but I'm always placing the "cut" in > the figure half way through - why does the cut keep creeping > up 'til it disappears? > > Usage details: matplotlib version=? (I forget how to get > that), numpy version = 1.0.4, Python version = 2.5.2, OS = > Windows XPProSP3, 504 MB RAM w/ "Physical Address > Extension" (whatever that means). > > DG > > PS: If the figures don't come through and for some > reason my code doesn't work on your platform or > doesn't reproduce the problem, email me and I'll > email you the figures directly. ```

 [Matplotlib-users] Fw: canvas.print_figure printing a variable amount of my figure From: David Goldsmith - 2008-09-30 21:20:40 ```I sent the below - with referenced attachments - about 24 hours ago and have yet to see it posted - was it blocked due to the attachments? DG --- On Mon, 9/29/08, David Goldsmith wrote: > From: David Goldsmith > Subject: canvas.print_figure printing a variable amount of my figure > To: matplotlib-users@... > Date: Monday, September 29, 2008, 5:59 PM > I feel like I must be missing something: below is some > "minimal sample" code which reproduces a > "problem" I'm seeing in a more complicated > situation: > > import matplotlib as MPL > from matplotlib.backends.backend_agg import FigureCanvasAgg > as FigureCanvas > from matplotlib.figure import Figure > > for DPI in range(100,201,25): > fig = Figure(figsize=(12,9), > dpi=DPI, > frameon=False) > canvas = FigureCanvas(fig) > > nx, ny = (N.uint16(12*DPI), N.uint16(9*DPI)) > temp = N.indices((ny, nx), N.uint8) > result = N.zeros_like(temp[0]) > result[:ny/2,:] = temp[0,:ny/2,:] + temp[1,:ny/2,:] > result[ny/2:,:] = temp[0,ny/2:,:] - temp[1,ny/2:,:] > fig.figimage(result/N.float(N.max(result))) > > canvas.print_figure("test"+str(DPI)+"dpi.png") > > Attached are the results on my computer (see usage details > below). Granted, I'm increasing the resolution each > iteration, but I'm always placing the "cut" in > the figure half way through - why does the cut keep creeping > up 'til it disappears? > > Usage details: matplotlib version=? (I forget how to get > that), numpy version = 1.0.4, Python version = 2.5.2, OS = > Windows XPProSP3, 504 MB RAM w/ "Physical Address > Extension" (whatever that means). > > DG > > PS: If the figures don't come through and for some > reason my code doesn't work on your platform or > doesn't reproduce the problem, email me and I'll > email you the figures directly. ```