SKR
SKR

Reputation: 27

How to write units raised to some number in titles of axes in an IDL plot window?

The titles of axes in a plot usually consists of units of some physical parameter. How do we represent such a unit, especially when it contains some letter raised to the power some number? For example, if the x-axis represents velocity, how can we represent m s^-1 properly as the xtitle?

Upvotes: 0

Views: 294

Answers (1)

mgalloy
mgalloy

Reputation: 2386

It depends on the graphics system you are using.

If you are using function graphics, then you can do something like:

IDL> p = plot(/test, ytitle='velocity $m s^{-1}$')

If you are using direct graphics, then do:

IDL> plot, findgen(10), ytitle='velocity m s!E-1!N'

See the Doc Center for a complete listing of the embedded graphics format codes.

There are also helpful library routines to help with direct graphics.

Upvotes: 1

Related Questions