<div dir="ltr">Okay. I figured out the problem. You need to pass a dictionary to the config magic. Here is the relevant code:<div><br></div><div>%config InlineBackend.print_figure_kwargs = {'bbox_inches':None}<br></div><div><br></div><div>I created a PR with IPython (<a href="https://github.com/ipython/ipython/pull/8051">https://github.com/ipython/ipython/pull/8051</a>) to add this information to the %matplotlib documentation, so this doesn't cause confusion for others. </div><div><br></div><div>Thanks to all the IPython and MPL devs for these great tools! </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 13, 2015 at 7:07 PM, Wes Turner <span dir="ltr"><<a href="mailto:wes.turner@gmail.com" target="_blank">wes.turner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Ryan,</p>
<p dir="ltr"><a href="http://wrdrd.github.io/docs/consulting/data-science.html#data-visualization-tools" target="_blank">http://wrdrd.github.io/docs/consulting/data-science.html#data-visualization-tools</a></p>
<div class="gmail_quote"><div><div class="h5">On Mar 13, 2015 1:59 PM, "Ryan Nelson" <<a href="mailto:rnelsonchem@gmail.com" target="_blank">rnelsonchem@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">I'm constructing a multi-plot figure using an IPython notebook (v3) and matplotlib (v1.4.3) inline magic. I was manually setting the axes bounds, and I ended up with something like the following:<div><br></div><div>########</div><div><div>import matplotlib.pyplot as plt</div><div>%matplotlib inline</div><div><br></div><div>bottom = 0.12</div><div>top = 0.9 </div><div>left = 0.12</div><div>axwidth = (1-(left*2))/3</div><div><br></div><div>fig = plt.figure(figsize=(10,4))</div><div><br></div><div>ax1 = fig.add_axes((left, bottom, axwidth, top))</div><div>ax1.set_title('Title')</div><div>#ax1.tick_params(labelleft=False)</div><div><br></div><div>ax2 = fig.add_axes((left+axwidth, bottom, axwidth, top), </div><div>                   sharex=ax1, sharey=ax1)</div><div>ax2.tick_params(labelleft=False)</div><div><br></div><div>ax3 = fig.add_axes((left+axwidth*2, bottom, axwidth, top),</div><div>                   sharex=ax1, sharey=ax1)</div><div>ax3.tick_params(labelleft=False)</div><div><br></div><div>fig.savefig('junk.pdf', format='pdf')</div><div>fig.savefig('junk2.png')</div></div><div>#######</div><div><br></div><div>Obviously, the bottom+top that I've selected is >1, so the axes should go off the top of the figure. (Stupid, I know...) The axes in both the PDF and PNG formatted files are clipped by the top of the figure as you would expect; however, the figure that is displayed in the Notebook looks just fine. In addition, if you add a title to one of the axes, the figure in IPython suddenly creates more space for the text. Maybe it is rearranging the axes information behind the scenes?</div><div><br></div><div>I'm curious why this design decision was made. I would say this is a bug. Now that I know about this behavior, I can easily fix it. But new users will be baffled when their saved figure looks nothing like the displayed figure in the notebook. </div><div><br></div><div>Ryan</div></div>
<br></div></div>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>