Re: Double tickmark annotations [message #22180] |
Wed, 25 October 2000 00:00 |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
David Fanning wrote:
>
> We really need to come up with a standard sarcasm glyph.
> I propose we form an ad hoc committee at the IDL Expert
> Programmer's Association annual meeting Friday, Oct 31st
> to come up with something. (Those of you who have been
> invited know where it is being held, of course.)
I would suspect its being held somewhere at a brewery that has a car
wash nearby, so that contestants may wash David's car easily.
> In case you are wondering, the date of our annual
> meeting was chosen to coincide with the general
> craziness of All Hollow's Eve. The thinking being that
> maybe we could save a little bail money this year
> and put it toward a project to document all the
> platform-specific features of IDL. :-)
The only thing I am surprised about is how come the meeting was not held
on Friday, October 13th?
But, on the other hand, I guess we can come trick-or-treating. I'll
dress up as a Kodak color film box, with an IDL logo on the bottom :-)
cheers,
Pavel
|
|
|
Re: Double tickmark annotations [message #22183 is a reply to message #22180] |
Wed, 25 October 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:
> And in case it wasn't obvious, this was an attempt at sarcasm. I
> found it ironic that several "ticks" questions had been discussed in
> the same day. No offense intended.
We really need to come up with a standard sarcasm glyph.
I propose we form an ad hoc committee at the IDL Expert
Programmer's Association annual meeting Friday, Oct 31st
to come up with something. (Those of you who have been
invited know where it is being held, of course.)
In case you are wondering, the date of our annual
meeting was chosen to coincide with the general
craziness of All Hollow's Eve. The thinking being that
maybe we could save a little bail money this year
and put it toward a project to document all the
platform-specific features of IDL. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Double tickmark annotations [message #22184 is a reply to message #22180] |
Wed, 25 October 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Craig Markwardt <craigmnet@cow.physics.wisc.edu> writes:
> You should pay more attention in the newsgroup which may solve your
> problem. Irene just pointed out today the XTICK_GET keyword to plot,
> which returns the values that IDL chose for the tick positions.
And in case it wasn't obvious, this was an attempt at sarcasm. I
found it ironic that several "ticks" questions had been discussed in
the same day. No offense intended.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Double tickmark annotations [message #22186 is a reply to message #22180] |
Wed, 25 October 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Shawn L. Young" <young@chaos.dartmouth.edu> writes:
> Hello,
> I would like to know how to give more than one name to a each
> tickmark along the x axis. For instance, I want to list both a satellite's
> latitude and radial distance from the center of the Earth along the x axis.
> However, I don't know ahead of time how these two quantities correlate so I
> can't hardwire tick names using xtickname. Is there a way to give the plot
> routine both arrays and have it determine the ticknames? If not, the help
> file is very brief on the use of xtickname. If I knew how IDL chose where
> to put the ticknames I might be able to write code to do the correlating on
> the fly. But when I am using a > 500 element array for the x axis and want
> to be sure that I am doing the best correlation I can between array
> elements and xtickname elements.
You should pay more attention in the newsgroup which may solve your
problem. Irene just pointed out today the XTICK_GET keyword to plot,
which returns the values that IDL chose for the tick positions.
That may not solve your problem totally since you want some way to
offset the second set of numbers. You can use the "!C" direct
graphics formatting code to get a carriage return. Perhaps this
snippet will help.
x = findgen(10)
plot, x, x*x
axis, xaxis=0, xtickname=['!C10','!C8','!C6','!C4','!C2','!C0']
Have fun,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Double tickmark annotations [message #22187 is a reply to message #22180] |
Wed, 25 October 2000 00:00  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
"Shawn L. Young" wrote:
>
> Hello,
> I would like to know how to give more than one name to a each
> tickmark along the x axis. For instance, I want to list both a satellite's
> latitude and radial distance from the center of the Earth along the x axis.
> However, I don't know ahead of time how these two quantities correlate so I
> can't hardwire tick names using xtickname. Is there a way to give the plot
> routine both arrays and have it determine the ticknames? If not, the help
> file is very brief on the use of xtickname. If I knew how IDL chose where
> to put the ticknames I might be able to write code to do the correlating on
> the fly. But when I am using a > 500 element array for the x axis and want
> to be sure that I am doing the best correlation I can between array
> elements and xtickname elements.
> Thanks
You can use XTICKFORMAT, which is a named function to which idl passes
each of it's desired tick values, along with which axis, and the index
of the tickmark. You can then calculate any string you like based on
this information, and return it for display. If, however, you don't
like how IDL is choosing its tick locations, you can certainly calculate
your own, along with labels, and use XTICKV and XTICKNAME. Presumably
this calculation would be based on the data itself, similar to the
calculation IDL does if you let it (or not). Here's an example such
calculation:
range=latest-earliest
divs=[1,2,5,10,15,30,60,120]*60L
n=float(range)/divs ;approximate number of these intervals
tmp=min(abs(n-8),wh) ;nearest to 8 tick intervals
low=ceil(float(earliest)/divs[wh])*divs[wh]
high=latest/divs[wh]*divs[wh]
nticks=(high-low)/divs[wh]
ticks=low+lindgen(nticks+1)*divs[wh]
This finds ticks at a certain preset list of intervals, ensuring that
not too many and not too few ticks are chosen. Obviously, it can't
accomodate any data range (actually in this case it's seconds less than
one day, so it can), so you might have to have more elaborate coding.
But it gives you an idea.
Also, you must know the correlation between your two independent
variables beforehand, since otherwise you wouldn't be able to relate
them during plotting at all. Perhaps I've misinterpreted you.
By the way, it sounds like yours is an excellent candidate for two axes
(top and bottom), for each of latitude and distance.
JD
--
J.D. Smith | WORK: (607) 255-6263
Cornell Dept. of Astronomy | (607) 255-5842
304 Space Sciences Bldg. | FAX: (607) 255-5875
Ithaca, NY 14853 |
|
|
|