GrADS comes with 5 fonts:
font 0 -- Simplex Roman
font 1 -- Complex Roman
font 2 -- Complex Italic
font 3 -- Complex Greek
font 4 -- Duplex Roman
font 5 -- Triplex Roman
'set font 2'
Font 3 is where the Greek symbols and characters are. The image below shows the alphabet and the following Greek character representations of each letter (in both upper and lower case).
Greek Fonts |
'font 3'
If you wanted to mix fonts it would be cumbersome to try to draw a series of "partial" strings next to each other with interspersing 'set font' commands. Luckily, GrADS has a feature that allows you to change the font within the string. To change the font within a string, all you need to do is type the accent Grave: [`] (and yes I had to google what this was called) followed by the font number you are interested in. For example:
'draw string 4.5 4.5 pi symbol = `3p `0'
This will write out the words: "pi symbol =" followed by the Greek symbol for pi (π). The `0 is set in, to reset the font to the default after the symbol.
You can use this same method to get superscripts and subscripts within your text. Similarly to the font changes, you use the Grave [`] followed by the font location identifier. The identifiers are shown below.
- `a = Above (Superscript)
- `n = Normal (Normal Text)
- `b = Below (Subscript)
'draw string x`a2`n'
The `n is once again put in there for housecleaning, so you simply return to the normal font. Putting it all together, we can write the formula for the area of a circle.
'draw string 4.5 4.5 A = `3p`0r`a2`n'
or if π isn't your thing ...
'draw string 4.5 4.5 A = (`3t`0/2)r`a2`n'
That is about it for this tutorial. Hopefully you have a better understanding on how to use the fonts in GrADS. I will mention that there is a way to import and use custom fonts, though I will not discuss how to do that here, if you want more information go to this website. Now, as a final tip, the degrees symbol is represented by the period (.) in the Greek font:
'draw string 4.5 4.5 `3.`0'
Hi!
ReplyDeleteI'd like to know how to use different font types. I read something about in GrADS tutorial, but I don't know where can I download another fonts.
Do you know something about?
Thanks!
who help me scripts for singular value decomposition(SVD) in GRADS ?
ReplyDelete