Embedding an MPL Canvas/Figure in a PyGTK Container

Adding line:
ax.set_xlabel(“asdf”)

To file (matplotlib examples):
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_gtk2.py

This sets the X-Label under the navigation toolbar. I am unable to set it such a way that the entire canvas is rendered in the container.

It would be of great help to know how this can be done.

Thanks,
W

The problem is really that the window is too small, the text is too large, and/or the axes is too large within the figure.

Try one or more of the following:

Replace the values for win.set_default_size to something larger, eg.

  win.set_default_size(800,600)

Replace the fig.add_subplot call with a fig.add_axes call that explicitly specifies the axes position:

   ax = fig.add_axes((0.2, 0.2, 0.6, 0.6))

Reduce the font size by adding the following to the top:

   from matplotlib import rcParams
   rcParams['font.size'] = 4

Reduce the dpi of the plot:

   fig = Figure(figsize=(5,4), dpi=60)

Cheers,
Mike

Vamsi Vytla wrote:

···

Adding line:
ax.set_xlabel("asdf")

To file (matplotlib examples):
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_gtk2.py

This sets the X-Label under the navigation toolbar. I am unable to set it such a way that the entire canvas is rendered in the container.

It would be of great help to know how this can be done.

Thanks,
W
------------------------------------------------------------------------

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Thanks for your reply Mike. Looks like fig.add_axes(…) works the best for me for now. If my situation gets worse I will try and look into calls that allocate window area for the figure/canvas in a container.

Thanks again!

···

On Mon, Apr 19, 2010 at 6:03 AM, Michael Droettboom <mdroe@…86…> wrote:

The problem is really that the window is too small, the text is too large, and/or the axes is too large within the figure.

Try one or more of the following:

Replace the values for win.set_default_size to something larger, eg.

win.set_default_size(800,600)

Replace the fig.add_subplot call with a fig.add_axes call that explicitly specifies the axes position:

ax = fig.add_axes((0.2, 0.2, 0.6, 0.6))

Reduce the font size by adding the following to the top:

from matplotlib import rcParams

rcParams[‘font.size’] = 4

Reduce the dpi of the plot:

fig = Figure(figsize=(5,4), dpi=60)

Cheers,

Mike

Vamsi Vytla wrote:

Adding line:

ax.set_xlabel(“asdf”)

To file (matplotlib examples):

http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_gtk2.py

This sets the X-Label under the navigation toolbar. I am unable to set it such a way that the entire canvas is rendered in the container.

It would be of great help to know how this can be done.

Thanks,

W



Download Intel® Parallel Studio Eval

Try the new software tools for yourself. Speed compiling, find bugs

proactively, and fine-tune applications for parallel performance.

See why Intel Parallel Studio got high marks during beta.

http://p.sf.net/sfu/intel-sw-dev



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Michael Droettboom

Science Software Branch

Operations and Engineering Division

Space Telescope Science Institute

Operated by AURA for NASA