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

Home » Public Forums » archive » Another idiosyncracy?
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: Another idiosyncracy? [message #91950 is a reply to message #91942] Tue, 22 September 2015 03:23 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Monday, September 21, 2015 at 8:19:20 PM UTC-3, laura...@gmail.com wrote:
> Why on earth does IDL require you to set the position of a legend by specifying a location for the upper RIGHT corner? It's much easier to see the upper left corner, and you don't have to keep readjusting the location every time the length of the labels changes. The more I try to do in IDL, the more I think it's time to learn Python....

I am not quite sure what you mean... Do you want a legend box that sits next to the left side? This would be the case requiring to change the coordinates with text length, if the coordinates are those of the right side.

Anyway, if you mean Function Graphics, you can choose whether the coordinates you give are those of the right or left side (or top or bottom, or center, or anywhere in between):


p=plot(/test,name='plot 1')

;put a legend box in the center:
l=legend(target=p,$
position=[0.5,0.5],/normal,horizontal_alignment=0.5,vertical _alignment=0.5)
;put a legend box in the top left:
l=legend(target=p,$
position=[0.0,1.0],/normal,horizontal_alignment=0.0,vertical _alignment=1.0)
;put a legend box in the top right:
l=legend(target=p,$
position=[1.0,1.0],/normal,horizontal_alignment=1.0,vertical _alignment=1.0)
;put a legend box in the bottom left:
l=legend(target=p,$
position=[0.0,0.0],/normal,horizontal_alignment=0.0,vertical _alignment=0.0)
;put a legend box in the bottom right:
l=legend(target=p,$
position=[1.0,0.0],/normal,horizontal_alignment=1.0,vertical _alignment=0.0)

Intermediate values for horizontal/vertical alignment allow for other possibilities. And there are aliases for the values 1.0 and 0.0: 'bottom', 'top', 'left' and 'right' (http://www.exelisvis.com/docs/LEGEND.html#HORIZONT)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Legend object without border
Next Topic: Error in IDL-Python Bridge

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

Current Time: Fri Oct 10 01:34:42 PDT 2025

Total time taken to generate the page: 0.96456 seconds