1+ import cdms2 , vcs , tempfile
2+
3+ txt = x .createtext ()
4+ txt .x = [.0000005 ,.00000005 ,.5 ,.99999 ,.999999 ]
5+ txt .y = [0.05 ,.9 ,.5 ,.9 ,0.05 ]
6+ txt .string = ["SAMPLE TEXT A" ,"SAMPLE TEXT B" ,"SAMPLE TEXT C" ,"SAMPLE TEXT D" ,"SAMPLE TEXT E" ]
7+ txt .halign = "center"
8+ txt .valign = "base"
9+ txt .height = 10
10+ x .plot (txt )
11+ tmpfile = tempfile .mkstemp (suffix = '.ps' , prefix = 'tmpTextAsObjectFalse' )
12+ x .postscript (tmpfile [1 ], textAsObject = False )
13+ tmpfile = tempfile .mkstemp (suffix = '.ps' , prefix = 'tmpTextAsObjectTrue' )
14+ x .postscript (tmpfile [1 ], textAsObject = True )
15+
16+ tmpfile = tempfile .mkstemp (suffix = '.pdf' , prefix = 'tmpTextAsObjectFalse' )
17+ x .pdf (tmpfile [1 ], textAsObject = False )
18+ tmpfile = tempfile .mkstemp (suffix = '.pdf' , prefix = 'tmpTextAsObjectTrue' )
19+ x .pdf (tmpfile [1 ], textAsObject = True )
20+
21+ tmpfile = tempfile .mkstemp (suffix = '.svg' , prefix = 'tmpTextAsObjectFalse' )
22+ x .pdf (tmpfile [1 ], textAsObject = False )
23+ tmpfile = tempfile .mkstemp (suffix = '.svg' , prefix = 'tmpTextAsObjectTrue' )
24+ x .pdf (tmpfile [1 ], textAsObject = True )
0 commit comments