Re: [Matplotlib-users] mpl 1.3 & xkcd

2013-10-17 Thread Matthias BUSSONNIER
> In the process, I also skimmed the 1.3 release notes. What's this? How > was it that I missed the new xkcd style??? Did you know about http://matplotlib.org/xkcd/gallery.html > > I don't know who is responsible for your marketing, but they clearly > need to blanket the world with press relea

[Matplotlib-users] mpl 1.3 & xkcd

2013-10-17 Thread Skip Montanaro
At work both mpl 1.1 and mpl 1.2 are installed. (I have no idea why.) Vagaries of our current packaging cause problems (import finds 1.1 before 1.2 in sys.path). The question was what to do. I took a look at the latest What's New document and concluded that removing 1.1 would be the best route. In

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

2013-10-17 Thread Nicolas Rougier
Would something like this suit your needs ? import matplotlib.pyplot as plt # Image size width,height = 640,480 # Pixel border around image border = 1 dpi = 72.0 figsize= (width+2*border)/float(dpi), (height+2*border)/float(dpi) fig = plt.figure(figsize=figsize, dpi=dpi, facecolor="white") hpi

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

2013-10-17 Thread Joe Kington
> > Unfortunately, figaspect is only an approximate solution, as it simply > uses the aspect ration of the image for the whole figure (with axes and > labels). > > I wonder how difficult it would be to teach matplotlib to tightly fit > the axes around an image, and, ideally, output the figure cro

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

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

2013-10-17 Thread Benjamin Root
On Thu, Oct 17, 2013 at 8:20 AM, Christoph Groth wrote: > 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

[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