comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » axis labels
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Axis labels [message #21689 is a reply to message #21576] Tue, 12 September 2000 14:19 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Ed Vigmond" <evigmon@tulane.edu> wrote in message
news:39BE83BA.B1985EBC@tulane.edu...
>
> I am trying to label an axis but I encounter a problem that I can't
> figure out. The font on the y-axis label comes out in different aspect
> ratios depending on the y range. Sometimes the font is totally
> unreadable and the rest of the time it is just ugly. Here is the code
> and sorry if it's a simple probblem but I was following the example in
> the on-line help.
>
> graph -> SetProperty, DATAX=x, DATAY=y
> graph -> GetProperty, XRANGE=xr, YRANGE=yr
> graph -> SetProperty, XCOORD_CONV=norm_coord(xr),
> YCOORD_CONV=norm_coord(yr)
> xaxis -> SetProperty, RANGE=xr, XCOORD_CONV=norm_coord(xr)
> yaxis -> SetProperty, RANGE=yr, YCOORD_CONV=norm_coord(yr)

The labels are OK when the axis is being created but they get squashed up
when it is re-scaled.

There are two ways to solve the problem:

1. Create the axes with the right scaling

xaxis = obj_new('IDLgrAxis', RANGE=xr, XCOORD_CONV=norm_coord(xr), ...)
yaxis = obj_new('IDLgrAxis', RANGE=yr, YCOORD_CONV=norm_coord(yr), ...)

2. Set the RECOMPUTE_DIMENSIONS property of all text objects associated with
the axis to 2 (look up IDL documentation for IDLgrText to see what this
means):

axis->GetProperty, TICKTEXT=oticktext, TITLE=otitle
if obj_valid(otitle) then begin
otitle->SetProperty, RECOMPUTE_DIMENSIONS=2
endif
for i=0,n_elements(oticktext)-1 do begin
if obj_valid(oticktext[i]) then begin
oticktext[i]->SetProperty, RECOMPUTE_DIMENSIONS=2
endif
endfor

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: String/integer use in variable definitions
Next Topic: Re: String/integer use in variable definitions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:53:15 PDT 2025

Total time taken to generate the page: 1.28051 seconds