0

I have an image displayed in an IDL window using the TV command, and would like to add x and y axes to the image. Seems straightforward, but I can't find a way to do it.

Can anyone help with this?

Thanks

2 Answers2

3

Are you tied to direct graphics, i.e., TV? Easiest way to display with axis is to use IMAGE function:

im = image(arr, axis_style=1)
mgalloy
  • 2,356
  • 1
  • 12
  • 10
0

I would echo Mike's answer - go with the new graphics Image function if possible.

If you absolutely have to use direct graphics, then I would recommend using David Fanning's coyote graphics wrappers: http://www.idlcoyote.com/idldoc/cg/cgimage.html

It's still a lot more work to do this using direct graphics, but at least with the "cg" commands it's easier.

Chris Torrence
  • 452
  • 3
  • 11
  • The version of IDL i'm using is on a university server, so I don't think I can install the Coyote library – user2137944 Apr 14 '15 at 00:56
  • You can install the coyote graphics programs in a subdirectory in your home directory and set your IDL path to point at it. For example, set the IDL_PATH environment variable to point at it with something like: export IDL_PATH=/home/me/idl/coyote:"" – mgalloy Apr 14 '15 at 05:05