The frameon argument shifts the plot axes to the right leaving a strip of blank canvas to the left of the plot axes, while increasing the figure's width. Altogether, a highly undesirable side-effect.
I'm using 1.2.0rc3
A search for frameon in issues produced nothing describing this problem. A wider google search uncovered a couple of references to this problem but the solution still eludes me.
I can't recreate this with the OS X or Qt4Agg backends. I also can't recreate it saving a png from Agg. All this is using master, which is currently at dc1d0ee.
I can't recreate this with OS X or Qt4Agg backends on the current v1.2.x tip, which is currently at da2d0c4.
I also can't recreate this with OS X or Qt4Agg on v1.2.0rc3.
Could you provide a little more information about your backend? And perhaps add a screen shot of the behaviour you are seeing? GitHub now allows you to drag an image into the comment box to attach it.
Thanks for reporting the problem, @pmacaodh.
I'm using the pylab backend in ipython:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
IPython 0.14.dev -- An enhanced Interactive Python.
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
Hope that can help you track it down. Thanks for you efforts!
The issue is with bbox_inches='tight which ipython uses in the inline backend.
The bounding box of the legend is only calculated when the frame is on. I have
a pull request fixing this shortly.
@pmacaodh Do you have the possibility to test the attached pull request?
By the way. This code illustrates the issue: (toggling between True and False
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
l = ax.legend('test', frameon=True)
@jenshnielsen I'm afraid I don't have the possibility to test the pull request - I'm not so proficient in these development tools.
Thanks for your efforts. I trust the fix will appear in the main code base soon so I'll hold tight until then.
@jenshnielsen If I am reading this thread correctly you think this if fixed. If I am incorrect please re-open.
yes this should be fixed