set figure position

We have recently switched to matplotlib after having done all plotting with pure wxPython for years.

There is one problem we cannot solve. With wxPython we are free to set the geometry (position and size) of each Frame anywhere on the screen. We have developed a heuristic solution which packs the Frames automatically according to a pattern that can be recognized after a user has manually repositioned a few Frames on the screen. For example, some users tend to align their figures in a row, others subdivide the available space for different groups of figures, and so on. Please let us know if anyone is interested to integrate this heuristic packing into matplotlib.

The important question is:
How can we set the position of a Figure on the screen using matplotlib? There is a function Figure.set_size_inches, but no function to move the Figure to a new position. Please help.

Regards,
Marie

···

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com

Hi marie,

You can define exactly the size and position of your plot like this:

fig = Figure()
axe = fig.add_axes([pos_x,pos_y,size_x,size_y])
axe.plot(x, y, 'b')

where pos_x,pos_y is a number (0<n<1) and 0,0 is bottom left
size_x, size_x is a number (0<n<1)
1 is full figure size.

Ex: axe = fig.add_axes([0.1,0.1,0.8,0.2])

Plot @10% x,10% y from bottom left
And size is 80% of figure x size and 20% of figure y size.

Laurent

-----Message d'origine-----

···

De : Marie De La Fontaine [mailto:marie.delafontaine@…9…]
Envoyé : dimanche 22 novembre 2009 18:05
À : matplotlib-users@lists.sourceforge.net
Objet : [Matplotlib-users] set figure position

We have recently switched to matplotlib after having done all plotting with
pure wxPython for years.

There is one problem we cannot solve. With wxPython we are free to set the
geometry (position and size) of each Frame anywhere on the screen. We have
developed a heuristic solution which packs the Frames automatically
according to a pattern that can be recognized after a user has manually
repositioned a few Frames on the screen. For example, some users tend to
align their figures in a row, others subdivide the available space for
different groups of figures, and so on. Please let us know if anyone is
interested to integrate this heuristic packing into matplotlib.

The important question is:
How can we set the position of a Figure on the screen using matplotlib?
There is a function Figure.set_size_inches, but no function to move the
Figure to a new position. Please help.

Regards,
Marie

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails.
http://mail.yahoo.com

----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Laurent Dufrechou wrote:

You can define exactly the size and position of your plot like this:

fig = Figure()
axe = fig.add_axes([pos_x,pos_y,size_x,size_y])

I believe the OP was asking how to position the entire figure Window (or frame in wx parlance) on the screen, rather than the axis within the figure.

If you are using the wx back-end, you should be able to get a reference to the wx.Frame, and do what you like with it. (sorry, I don't remember how to do that off the top of my head, though if need be a few calls to GetParent should get you there).

If you are using another back-end there should be a similar calls available.

However, given your description, I suspect that you'd be better off managing the frames with your code anyway. Take a look at wxMPL (http://agni.phys.iit.edu/~kmcivor/wxmpl/) and/or the "embedded_in_wx" examples.

-Chris

···

axe.plot(x, y, 'b')

where pos_x,pos_y is a number (0<n<1) and 0,0 is bottom left
size_x, size_x is a number (0<n<1)
1 is full figure size.

Ex: axe = fig.add_axes([0.1,0.1,0.8,0.2])

Plot @10% x,10% y from bottom left
And size is 80% of figure x size and 20% of figure y size.

Laurent

-----Message d'origine-----
De : Marie De La Fontaine [mailto:marie.delafontaine@…9…] Envoyé : dimanche 22 novembre 2009 18:05
À : matplotlib-users@lists.sourceforge.net
Objet : [Matplotlib-users] set figure position

We have recently switched to matplotlib after having done all plotting with
pure wxPython for years.

There is one problem we cannot solve. With wxPython we are free to set the
geometry (position and size) of each Frame anywhere on the screen. We have
developed a heuristic solution which packs the Frames automatically
according to a pattern that can be recognized after a user has manually
repositioned a few Frames on the screen. For example, some users tend to
align their figures in a row, others subdivide the available space for
different groups of figures, and so on. Please let us know if anyone is
interested to integrate this heuristic packing into matplotlib.

The important question is:
How can we set the position of a Figure on the screen using matplotlib?
There is a function Figure.set_size_inches, but no function to move the
Figure to a new position. Please help.

Regards,
Marie

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails. http://mail.yahoo.com

----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus
on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...