Re: Changing the labels orientation [message #54281 is a reply to message #54202] |
Tue, 29 May 2007 10:40   |
jujo
Messages: 8 Registered: May 2007
|
Junior Member |
|
|
On 29 maio, 05:11, Tim <timrobis...@gmail.com> wrote:
> Hi there Hervé,
>
> Here's how you could do it in an almost general fashion:
>
> x = findgen(100)*1d19
> y = sqrt(x)
> charsize=2.0
> ; PLOT THE DATA, DON'T LABEL THE X AXIS AND RETURN THE XTICK VALUES...
> plot, x, y, XTICKFORMAT='(A1)', XTICK_GET=xticks, YMARGIN=[9,2], $
> CHARSIZE=charsize
> ; CONVERT THE XTICK VALUES TO NORMALIZED POSITION...
> xtickpos = !x.s[0] + !x.s[1]*xticks
> ; GET THE CHARACTER HEIGHT AND WIDTH IN NORMALIZED COORDINATES...
> y_ch_size = charsize * float(!d.y_ch_size) / !d.y_vsize
> x_ch_size = charsize * float(!d.x_ch_size) / !d.x_vsize
> ; PUT THE LABELS AT THE APPROPRIATE TICK POSITIONS...
> xyouts, xtickpos+0.5*x_ch_size, !y.window[0]-0.5*y_ch_size, /NORM,
> xticks, $
> ALIGN=1.0, ORIENTATION=90.0, CHARSIZE=charsize
>
> It sounds like in your case you already have the value of xticks and
> rather than retrieving xticks via XTICKS_GET, you'll probably be
> specifying the tick values immediately using XTICKS and XTICKV. You
> can change the ORIENTATION to 45 to save a little more room for the
> plot.
>
> Hope this helps! Best -Tim.
Thanks Tim, the code is fine!!
Best!
|
|
|