plot label help [message #10174] |
Wed, 08 October 1997 00:00  |
rickeym
Messages: 6 Registered: September 1997
|
Junior Member |
|
|
I'm using IDL to plot a curve on a log-log scale. I want the y axis
labels to be in powers of 10 (i.e. 10^0, 10^1, 10^2, ect). Some times the
yxis is lableld the way i want, other times the axis reads 1.0, 10.0,
10.0, ect. Is there a way to always have the y axis labels the way i
need. Thanks for any help!
Rick McDaniel
rickeym@hubcap.clemson.edu
|
|
|
Re: plot label [message #48245 is a reply to message #10174] |
Tue, 04 April 2006 14:11  |
wgallery
Messages: 32 Registered: December 1998
|
Member |
|
|
Steve.Morris@libero.it wrote:
> Hi guys!!
> I would like to make some plots, but only with certain number shown in
> the x and y axis. Is there any clever command to do that in IDL ??
>
> For example write only 3000, 3500, 4000, 4500 rather then
> 3100,3200,3300 etc ....
> Or, example, to write 3000 in bigger size, 3500 in smaller, 4000 in
> bigger on so on ...
>
> Thanks!
> S.
Try using a combination of xticks, xtickv and xtickname as in the
following example:
;;Program to demonstrate placing axis tick marks at specified values.
;;Plot a straight line from 0 to 1 with x-ticks at the following
locations:
values = [0, .3, .6, .9, 1.0]
n_int = 4 ;number of x intervals (not x values)
;;labels are what is actually printed at each tick mark
;;The '!d' and '!n' modifiers are positioning commands (in the IDL help
index, see
;;'positioning: commands'. The second and forth labels will be lowered.
labels = ['0', '!b0.3', '!n0.6', '!b0.9', '!n1.0']
plot, [0, 1], [0, 1], $
xticks = n_elements(labels)-1, $ ;number of tick intervals
xtickv = values, $ ;x-value of each tick mark
xtickname = labels ;text printed at each tick mark
end
|
|
|
Re: plot label [message #48247 is a reply to message #10174] |
Tue, 04 April 2006 10:03  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Steve.Morris@libero.it wrote:
> Hi guys!!
> I would like to make some plots, but only with certain number shown in
> the x and y axis. Is there any clever command to do that in IDL ??
Clever? No.
> For example write only 3000, 3500, 4000, 4500 rather then
> 3100,3200,3300 etc ....
> Or, example, to write 3000 in bigger size, 3500 in smaller, 4000 in
> bigger on so on ...
Dunno about the latter, but the former should be able to be done with judicious use of the
[xy]ticks and [xy]tickv keywords to plot.
For the latter, you'd probably have to use xyouts (yuk). But maybe you can also do it with
[xy]tickv, but including formatting commands as part of the tick labels? E.g. !U ? It'll
superscript the number but also make it smaller.
I'm sure it can be done in OG, but it'll probably take a week to write the code to do it. :o)
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
|
|
|