[I accidentally sent this message privately to the sender before. . . why doesn't this list set the Reply-To header to the list?]
Darren Dale wrote: >> On Wednesday 16 August 2006 02:26, Brendan Barnwell wrote: > >>>> Hi, I'm trying to get matplotlib to give me a plot where the legend is >>>> outside the axes. >>>> >>>> I saw several posts about this in the mailing list archives, but none of >>>> them really seem to provide workable solutions. > >> >> Try passing the loc kwarg to legend(). Like legend([...], loc=(1.01, 0.25)) Thanks, that works after a fashion. Again, though, I can't figure out a programmatic way to decide what values to use there. I would like to be able to calculate the size of the window, calculate the size of the legend, and then set the size of the axes so that everything fits nicely. Why is it that the sizes and positions for axes and legends are specified in totally different units (proportional vs. pixel)? Is there a way to say "I want the axes to take up 80% of the window and the legend to take up the remaining 20%"? Is there a way to change the format of the legend, so that it is, for example, in two columns instead of one? Or to get the legend text to word wrap within a fixed-width box instead of just causing the legend box to grow without bound? What I'm trying to do is figure out how to programmatically arrange the various elements in the plot window so that they look nice. I guess the simplest question I can ask is: how can I getthe width of the legend and the width of the axes in comparable units? If I could at least get that, I could manually calculate how big the axes should be. >>>> Or, alternatively, is there some easier way to get legends to NEVER >>>> overlap lines? > >> >> try legend([...], loc='best') That doesn't work, because 'best' apparently isn't implemented for figure legends, and if I use an axes legend then it sometimes overlaps the lines. -- --Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown ------------------------------------------------------------------------- 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=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users