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
|
|
|