WYSIWYG figure

Paul Ivanov <pivanov314@...287...> writes:

The tiling manager was the guilty one (I use AWESOME). The set_size
command did not work:
Traceback (most recent call last):
  File "/tmp/py2262sxl", line 45, in <module>
    fig.set_size_inches(pylab.rcParams['figure.figsize'], forward='True')
  File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 447, in set_size_inches
    manager.resize(int(canvasw), int(canvash))
TypeError: resize() takes exactly 2 arguments (3 given)

But once I mage have made the figure foating, it took the correct size.


Hi Petro,

Petro, on 2012-01-11 15:39, wrote:

Can I set a figure to appear on my screen in the same way as it is saved
in png file?

You sure can. A likely reason these two don't appear the
same is that your 'figure.dpi' rcParam is not the same as the
'savefig.dpi' parameter. The same may apply to 'figure.facecolor'
and 'figure.edgecolor' and their savefig counterparts.

Another reason might be that you're using a tiling window
manager. I use xmonad, and it will resize figures so that they
all fit on the screen without overlap, and since I put the call
to plt.show() *after* savefig, the figures get saved as whatever
size they were originally created as, but then show up as
whatever space they can fit into given that my window manager
resized them. You can resize them back, assuming that 'f' is the
Figure instance, using something like:

f.set_size_inches(plt.rcParams['figure.figsize'], forward=True)


Petro Khoroshyy