Font size and axis range in 'IDLgrAxis' class [message #62026] |
Thu, 21 August 2008 05:20 |
Rajiv.Paneerselvam
Messages: 14 Registered: November 2005
|
Junior Member |
|
|
Dear all,
Here is my problem..
I initialized an 'IDLgrAxis' object with a default title , font and
axis range.
I used 'IDLgrFont' and 'IDLgrText' objects for creating font size and
title, and I set the range from 1 to 300
I want to change the axis title and range (e.g 300 to 700), of the
created IdlgrAxis object.
After setting the new title and new range the font size of the axis
title text was changed and elongated along the x direction!.
here is the code..
;Create text and font objects
yFont = OBJ_NEW('IDLgrFont', 'Times', SIZE = 8)
ytext = OBJ_NEW('IDLgrText', 'S No', Font = yFont,
Enable_Formatting=1 )
;Create axis object and initialize with text and font objects
yAxis1 = Obj_New("IDLgrAxis", 1, Ticklen=0.025, Exact=1,$
Minor=4, Title = ytext, Range = [1,300], Location=[0.15, 1000, 0])
yAxis1->GETPROPERTY, Ticktext=yAxisText,Range=yrange
yAxisText->SETPROPERTY, Font=yFont
; Calculate scaling factors.
ys = Normalize(yrange,Position =[0.15,0.95])
yAxis1->SetProperty, YCoord_Conv=ys
;Then I added all these objects to IdlgrModel,- IdlgrView, references
and plotted using 'IdlGrwindow 'reference ,
;these steps are Ok
;Now I changed the title, range of the axis object
ytext->setproperty, STRINGS = 'Temperature'
yaxis1->setproperty, Title = ytext, RANGE = [300, 700]
yAxis1->GETPROPERTY, Range = yrange
; Calculate scaling factors.
ys = Normalize(yrange,Position =[0.15,0.950000])
; Scale the axes into 0->1.
yAxis1->SetProperty, YCoord_Conv=ys
; then I plotted using Idlgrwindow reference , but the axis texts look
different and elongated in one direction .
Any suggestions to restore the correct font size?.(I don't want to
destroy the created axis object and initialize another object with a
new axis range)
best regards,
Rajiv
|
|
|