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

Home » Public Forums » archive » Help with IDLgrAxis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Help with IDLgrAxis [message #11394] Wed, 08 April 1998 00:00 Go to next message
El-Kady, Mostafa is currently offline  El-Kady, Mostafa
Messages: 2
Registered: April 1998
Junior Member
Hello,

I am trying to draw an axis with variable tick interval. As I understood
from the documents, I can use TICKVALUES to do that. So, here is what
I did:

ticks = [0, 0.1, 0.3, 0.8, 1.0]
text = OBJ_NEW('IDLgrText', STRING(ticks))
axis = OBJ_NEW('IDLgrAxis', 0, MAJOR=N_ELEMENTS(ticks), /EXACT, $
TICKTEXT=text, TICKVALUES=ticks)

The resulting axis has tickvalue of 0, 0.1, 0.3, 0.8, 1.0 as I want
it, but at equal intervals. From the GetProperty method, I get
TICKVALUES as 0.00 0.25 0.50 0.75 1.00

Has anyone got this problem?

Thanks.
Re: Help with IDLgrAxis [message #11476 is a reply to message #11394] Thu, 09 April 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Martin Schultz (mgs@io.harvard.edu) writes:

> ??????????
> David: are you on vacation ?
>
> Here is a simple program for direct graphics that does it:

Uh, you know the thing I like about IDL? After a certain
period of time, you begin to forget more about it than you
used to know. This gives you the opportunity to re-learn
everything again. Keeps everything fresh that way, if you
know what I mean. :-)

Let's just say that there is only so much room in the ol'
noggin, and if I'm going to put object programming in, something
is going to have to fall out. Thank God, Dick arrives next week.
In the nick of time it looks like. :-(

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Help with IDLgrAxis [message #11478 is a reply to message #11394] Thu, 09 April 1998 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning wrote:
>
> Mostafa El-Kady (mostafa@kraken.atmos.colostate.edu) writes:
>
>> I am trying to draw an axis with variable tick interval. As I understood
>> from the documents, I can use TICKVALUES to do that. So, here is what
>> I did:
>>
>> ticks = [0, 0.1, 0.3, 0.8, 1.0]
>> text = OBJ_NEW('IDLgrText', STRING(ticks))
>> axis = OBJ_NEW('IDLgrAxis', 0, MAJOR=N_ELEMENTS(ticks), /EXACT, $
>> TICKTEXT=text, TICKVALUES=ticks)
>>
>> The resulting axis has tickvalue of 0, 0.1, 0.3, 0.8, 1.0 as I want
>> it, but at equal intervals. From the GetProperty method, I get
>> TICKVALUES as 0.00 0.25 0.50 0.75 1.00
>
> As far as I know, it is NOT possible to create an axis in
> either direct or object graphics with variable tick intervals,
> unless you entirely suppress the tick labels and marks and
> draw them yourself with low-level routines like PlotS and XYOutS.
>

??????????
David: are you on vacation ?

Here is a simple program for direct graphics that does it:

-------------------
pro varticks

; plot axis with variable tick intervals
plot,findgen(10),color=1,xticks=4,xtickv=[ 0., 1.5, 3.7812, 10. ]
; overplot regular intervals to prove the point
plot,findgen(10),color=2,/noerase

return
end
-------------------

> I don't think it would be too hard to write your own variable
> interval axis routine from scratch, however. (Perhaps Martin
> Schultz will do it for us. He has been in the programming
> groove lately. :-) )

well true. But I don't have to reinvent *every* wheel that's out there
;-)

Regards,
Martin

--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL to C translator
Next Topic: bug in idl5.03

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

Current Time: Wed Oct 08 13:43:57 PDT 2025

Total time taken to generate the page: 0.00650 seconds