comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » automatic placement of legend in 2-D graph
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: automatic placement of legend in 2-D graph [message #58492 is a reply to message #58285] Wed, 30 January 2008 14:44 Go to previous messageGo to previous message
Jean-Paul Davis is currently offline  Jean-Paul Davis
Messages: 17
Registered: March 1998
Junior Member
I thought I would share this in case someone finds it useful. After
spending a shameful amount of time barking up wrong trees, I finally
hit on a very simple solution to (semi-) automatic legend placement:

1. determine the legend's boundaries in device coordinates (i.e.,
pixels in the window)
2. hide the legend and redraw
3. get the window's image_data property
4. loop through possible legend positions (in device coordinates) to
find one that has the fewest (preferably zero) non-background-color
pixels in the region of the image defined by the legend boundaries
5. translate the legend accordingly, unhide it, and redraw

Jean-Paul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Travel Destination: Holland
Next Topic: Re: Re-gridding Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:57:23 PDT 2025

Total time taken to generate the page: 0.16040 seconds