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

Home » Public Forums » archive » Re: IDLgrAxis set TICKVALUES in specific positions
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: IDLgrAxis set TICKVALUES in specific positions [message #61424 is a reply to message #61422] Thu, 17 July 2008 09:32 Go to previous messageGo to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
On Jul 17, 11:39 am, David Fanning <n...@dfanning.com> wrote:

> I think you would get the text object from your axis with
> the TICKTEXT keyword, then set the LOCATIONS of the strings.
>

I tried it with no results. EXAMPLE:

values=['0','30','50','70']
values_pos=['50','55','76','256']
text_arr=objarr(n_elements(values))
for i=0, n_elements(values)-1 do begin
itext=OBJ_NEW('IDLgrText', values[i], FONT=self.font, $
RECOMPUTE_DIMENSIONS=2, /ENABLE_FORMATTING)
text_arr[i]=itext
endfor

;-- then the axis

axis=OBJ_NEW('IDLgrAxis', 1, TEXTPOS=1, TICKDIR=0, $
TICKTEXT=text_arr, /EXACT, MAJOR=N_ELEMENTS(values), MINOR=0,
TICKLEN=3)

axis->GetProperty, TICKTEXT=ticktext, YCOORD_CONV=ys
for i=0, n_elements(ticktext)-1 do begin
location=[ys[0], (values_pos[i]/256.)*ys[1]]
ticktext[i]->SetProperty, LOCATION=location
endfor

xobjview, axis
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Font compatibility question
Next Topic: Re: Font compatibility question

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

Current Time: Fri Oct 10 12:52:37 PDT 2025

Total time taken to generate the page: 0.56219 seconds