0

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?

mgalloy
  • 2,356
  • 1
  • 12
  • 10
SKR
  • 3
  • 3

1 Answers1

1

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.

mgalloy
  • 2,356
  • 1
  • 12
  • 10
  • Thanks @mgalloy, that worked. Could you please give the links for the relevant documents so that I can refer them for more complicated needs in the future. – SKR Jan 28 '19 at 18:39
  • Updated my answer with the link. Glad that was useful! – mgalloy Jan 28 '19 at 20:02