[Matplotlib-users] Spurious borders when setting figure size

2013-10-18 Thread Christoph Groth
Hello, The script pasted below plots a square array. The (very small) output PDF is attached to this posting. For reasons I do not understand, there's a fine additional border immediately at the top and bottom of the array. If the commented-out line of code is removed, the strange border disapp

Re: [Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-18 Thread Christoph Groth
Nicolas Rougier writes: > Would something like this suit your needs ? > > (...) Thanks. Setting figsize is indeed the way to achieve (almost) what I wanted. My other followup in this thread describes the remaining issue.

Re: [Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-18 Thread Christoph Groth
Joe, thank you very much for your reply. So the "figsize" of a matplotlib plot is the physical size of the region between the axes where the data is shown? If this is indeed the case, as it seems, then achieving (almost) what I wanted is as easy as setting a figsize with the proper aspect ratio,

Re: [Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-17 Thread Christoph Groth
Benjamin Root writes: > I particularly like using the figaspect() function: > > (...) > > It isn't perfect, but for its simplicity, it gets it mostly right. Thanks, Benjamin, for your quick reply. Unfortunately, figaspect is only an approximate solution, as it simply uses the aspect ration of th

[Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-17 Thread Christoph Groth
Hello, I'm stuck trying to find a solution to the following problem. I'd like to show an array using imshow preserving the 1:1 aspect ratio of its pixels. At the same time, I would like the axes to fit around the image tightly. Is there some way to, for example, choose a certain figure width, a

[Matplotlib-users] Optimal resolution for imshow

2013-04-19 Thread Christoph Groth
Hello, Is there a way to find out the optimal resolution that an array (of a given aspect ratio) should have, so that imshow will not re-scale it on a pixel-based backend? Some background: I'm preparing an array that has a native resolution, so for PDF output I use imshow with interpolation='none

Re: [Matplotlib-users] Suggestion: "show figures with default backend"

2012-06-25 Thread Christoph Groth
Christoph Groth writes: > show_figures([Figure().add_subplot(1,1,1).plot(range(10)), > Figure().add_subplot(1,1,1).plot([x*x for x in range(10)])]) This wouldn't work of course, it should be rather f1 = Figure() f1.add_subplot(1, 1, 1).plot(range(10)) f2 = Figure() f2.

[Matplotlib-users] Suggestion: "show figures with default backend"

2012-06-25 Thread Christoph Groth
Dear matplotlib developers, I prefer to use matplotlib in my scripts without its state-machine wrapper and it works mostly nicely. One thing which is missing currently is a standard way to display a bunch of figures using the default backend. What I have to do now is: from matplotlib.pyplot imp