2

I would like to know if it is possible ( and how to ) plot numbers in scientific notation (e.g. 4e2 instead of 400) while plotting diagrams with IDL's plot package.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
camelian77
  • 21
  • 1
  • 2

1 Answers1

2

You can specify a format for tick values using IDL's standard formatting codes and the [XY]TICKFORMAT keywords. For example, to specify scientific notation for the x axis values, use the following:

IDL> plot, findgen(10000), xtickformat='(E7.1)'
mgalloy
  • 2,356
  • 1
  • 12
  • 10
  • thanks for the reply. can u also help us the way to print 4x10^2 in IDL plot? – camelian77 Jul 27 '11 at 09:55
  • Sorry for the delay, I didn't see the followup question. Check the docs for the XTICKFORMAT keyword. You can set it to be the name of a routine that does custom string formatting instead of a format string. The [docs](http://idlastro.gsfc.nasa.gov/idl_html_help/Graphics_Keywords.html#wp332347) have the signature for the routine and an example. – mgalloy Aug 17 '11 at 20:06