Personal tools
You are here: Home CDAT Tips and Tricks Templates tips Scaling Templates
Document Actions

Scaling Templates

by Renata McCoy last modified 2007-05-08 10:39

Goal: Learn how to scale templates in CDAT.


You can manipulate the template by chaging plot's ratio (changing it's aspect ratio), scaling it or moving.

x=vcs.init()
t=x.createtemplate(‘new’)

Changing template's ratio

# make y twice as big as x
x.ratio=2 
# return to automatic default ratio
x.ratio=‘auto’
# move also tick marks
x.ratio=‘2t’

Scaling the template

# half size 
t.scale(.5)  
#half size in X, font unchanged
t.scale(.5, axis=‘x’) 
# also alter fonts
t.scale(.5, axis=‘x’, font=1)

Moveing the template
 
# move by 20% in x, 40% in y 
t.move(.2, .4)
# Positive values means up/right
# move lower left corner of data to x,y 

t.moveto(x,y)

Powered by Plone