[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling axis labels in IDL plots?



Rachel Howe <rhowe@noao.edu> wrote in message
news:38F673F6.7A8BA656@noao.edu...
> "Liam E.Gumley" wrote:
> >
> > Rachel Howe wrote:
> > >
> [Snip]
> > > Does anyone know how the distance of the axis label from the axis is
> > > determined in a single-panel 2d plot?
> >
> [Snip]
> > > Or would it be easier to give up and just use
> > > XYOUTS to put the annotations where I want them?
> >
> > Here's a quick and dirty method which can be used to push the X and Y
> > axis labels further away from the axes using the !C (carriage return)
> > font positioning code:
> >
> > ;- Set a reasonable character size and create data
> > device, set_character_size=[10, 12]
> > x = findgen(200) * 0.1
> > y = sin(x)
> >
> > ;- Default axis label positions
> > plot, x, y, xtitle='X AXIS', ytitle='Y AXIS'
> >
> > ;- Move X axis label down one character
> > IDL> plot, x, y, xtitle='!CX AXIS', ytitle='Y AXIS'
> >
> > ;- Move Y axis lable left one character
> > IDL> plot, x, y, xtitle='X AXIS', ytitle='Y AXIS!C'
> >
> > I find this particularly useful when adding titles to maps which have a
> > box grid:
> >
> > window, /free
> > map_set, -30, 130, scale=40e6, $
> >   xmargin=[2, 2], ymargin=[2, 4], title='MAP TITLE!C'
> > map_continents
> > map_grid, /box, charsize=0.75
> >
> > Unless you add the trailing !C to the title, it is displayed at the same
> > height as the top row of longitude labels. If this method doesn't suit
> > your needs, I think you will have to resort to manually positioned
> > labels.
> >
>
>
> And presumably one could go the other way using !D?

!D actually shifts down to the first subscript level.

All you need to do is put the !C immediately before or after the title
string in question, to shift the title down or up relative to the default
position.

Cheers,
Liam.