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

Home » Public Forums » archive » How can i put in a IDLgrAxis non constant values ?
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
How can i put in a IDLgrAxis non constant values ? [message #56791] Fri, 16 November 2007 12:07 Go to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
My question is really simple but I don't know how to put non constant
values in IDLgrAxis...

I want to put in the IDLgrAxis non constant values like:
[0, 10, 20, 30, 40, 41, 42, 43, 44, 45, 50, 60, 70] but conserving the
distance between the values

,___,___,___,___,___,___,___,___,___,___,___,___,
0 10 20 30 40 41 42 43 44 45 50 60 70

How can I do this ??
Re: How can i put in a IDLgrAxis non constant values ? [message #56964 is a reply to message #56791] Sun, 25 November 2007 14:48 Go to previous message
badjelly.witch is currently offline  badjelly.witch
Messages: 27
Registered: May 2006
Junior Member
On Nov 17, 9:07 am, natha <bernat.puigdomen...@gmail.com> wrote:
> My question is really simple but I don't know how to put non constant
> values in IDLgrAxis...
>
> I want to put in the IDLgrAxis non constant values like:
> [0, 10, 20, 30, 40, 41, 42, 43, 44, 45, 50, 60, 70] but conserving the
> distance between the values
>
> ,___,___,___,___,___,___,___,___,___,___,___,___,
> 0 10 20 30 40 41 42 43 44 45 50 60 70

It's been a while since this question was asked, but I don't see a
reply, so...

The best way, I think, is to plot against an underlying variable that
*is* equi-spaced. So, in the above example, let's call the variable
you want to show in the axis object x and the equi-spaced variable xx,
and you want
x = 0 <-> xx = 0, x = 10 <-> xx = 10, etc, up to x = 70 <-> xx = 12.
For each, data point, you need to calculate xx. That's up, to you, but
I assume you have a piecewise linear relationship, which shouldn't be
too hard to code.

So, you've plotted your y variable (or whatever), against xx, how do
you get the tick marks in the right place with the right labels. To
get them in the right place, set the TICKVALUES property. While you're
at is suppress minor tick marks.

oax->SetProperty, TICKVALUES=indgen(13), MINOR=0

To get the labels right you can hard-code them. The following should
work, providing it's done after the axis has been initialised:

oax->GetProperty, TICKTEXT=otext
otext->SetProperty, STRINGS=['0','10',...,'70']

where you're going to have to fill in the "...".

Better, though, to use the TICKFORMAT property and supply a function
that will produce the right label, given the respective values of xx.
The manual explains how to do this.

Cheers...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: filesearch doesn't find the same files as findfile on a networked drive (unencrypted)
Next Topic: Re: Using IDL shell in crontab

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

Current Time: Wed Oct 08 19:33:59 PDT 2025

Total time taken to generate the page: 0.00520 seconds