Re: [Matplotlib-users] Controling legend alignment

2006-10-30 Thread David Goldsmith
John Hunter wrote:
 David == David Goldsmith [EMAIL PROTECTED] writes:
 

 David Hi!  OK, loc=(a,b) positions the legend, and appears to
 David place the lower left corner at (a,b) (axes coords.), right?

 yes

 David Is there some way to say that (a,b) should specify the
 David location of, say, the center of the legend?  Thanks!

 Afraid not.
   
OK, I was afraid of that; in that case, is there some way to get the 
height and width of the legend (so I can do what I want 
programatically)?  Thanks again,

DG
 JDH

 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Controling legend alignment

2006-10-30 Thread John Hunter
 David == David Goldsmith [EMAIL PROTECTED] writes:

David OK, I was afraid of that; in that case, is there some way
David to get the height and width of the legend (so I can do what
David I want programatically)?  Thanks again,

Again, afraid not.  At least nothing obvious.  The legend placement is
done dynamically at draw time, and so it will be difficult to get this
information ahead of time.  There might be some cleverness that can be
applied, but nothing easy.

One option would be connect to the draw event, and then inspect the
legend properties, and then place it where you want knowing the width
and the height.  Not too elegant, but serviceable.  Here is an 
untested sketch


def ondraw(event):
if ondraw.done: return 
# in pixels
left,bottom,width,height = leg.legendPatch.get_window_extent().get_bounds()
# move your legend
ondraw.done = True
ondraw.done = False

fig = figure()
ax = fig.add_subplot(111)
leg = ax.legend(blah)
fig.canvas.mpl_connect('draw_event', ondraw)


It might be better to patch legend directly to do what you want and
send the patch our way.  Or subclass it.

JDH

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Crash on OS X 10.4.7 with Univ. Python 2.4.3 and Tk frontend

2006-10-30 Thread Alan G Isaac
On Thu, 26 Oct 2006, Michele Vallisneri apparently wrote: 
 I've been building matplotlib 0.87.7 on a 10.4.7 OS X system, with 
 Universal Python 2.4.3 from pythonmac.org. I've been following 
 instructions at 
 http://sourceforge.net/mailarchive/message.php?msg_id=36901627 

Please keep posting your experiences.
At work I'm about to spend my first ever time on a Mac,
and I expected this to be a blessing,
but such reports worry me!

Thanks,
Alan Isaac




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Controling legend alignment

2006-10-30 Thread Christopher Barker
John Hunter wrote:
 The legend placement is done dynamically at draw time,

Ah, so it looks like it does make sense for the user to specify an 
alignment, and have it figured out at draw time.

 It might be better to patch legend directly to do what you want and
 send the patch our way.  Or subclass it.

That does seem the way to go. David, I've done stuff like this for the 
wxPython FloatCavnas -- perhaps I can help, if you want to do it.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/ORR/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Scaling graph

2006-10-30 Thread Gerardo Rivera
Hi,

I'm trying to draw a line given an angle, magnitude, x0 and y0 
location on a 2d line plot.  I use the cosine and sine to find 
the x1 and y1 locations so that I can draw a line segment from x0, y0 
to x1, y1.  This works fine on a 200 x 200 (Width x Height) pixel 
graph.   However, I have an input form where the user can change the 
plot size, for example 200x800 or 800x200.

The magnitude is along the y-axis and time is along the x-axis. 
At a particular point in time the magnitude and angle is given and I 
have to calculate the x1 and y1 values.  The max magnitude along the 
y-axis (height) is always the same whether it is 200 pixels in height 
or 800 pixels in height.

The scientist I'm working with wants to see the magnitude (x1,y1) of 
each plot look correct if the graph is 800 pixels or 200 pixels in 
height.   He also wants the correct angle if you stretch the graph 
from 200 pixels wide to 800 pixels wide and then down to 100 pixels 
wide.

I've been trying to use a ratio of the graph size to maintain the 
correct sizing but with no luck.   Basically, the scientist want to 
maintain the same angle and reduce or increase the magnitude in the 
y-axis if the graph height is reduced or increased.

Does anyone have an answer to this solution?  Maintaining the same 
angle and varying the magnitude based on the y-axis height.

Since, I have a lot of points I started to use a LineCollection to 
speed the rendering speed.

Gerardo

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users