Anthony Smith's IDL routines

Galaxies etc.

single page | use frames     summary     class     fields     routine details     file attributes

misc/

ajs_plot_pos.pro

topajs_plot_pos

result = ajs_plot_pos( [x] [, y] [, x_in=x_in] [, y_in=y_in] [, xrange=xrange] [, yrange=yrange] [, xlog=xlog] [, ylog=ylog])

Return the location on the plot in data co-ordinates given input value(s) between 0 and 1.

Like using xyouts or plots with /normal but between the axis limits rather than the whole extent of the plot area

Return value

Position in data units corresponding to input x, y, [x, y], [x], [y] or [[x], [y]]

Parameters

x in optional

x-position, between 0 (left-hand side) and 1 (right-hand side). Or [N, 2] values for [x, y]

y in optional

y-position, between 0 (bottom) and 1 (top). Ignored if x is [N, 2]

Keywords

x_in in optional

x-position (as x parameter; ignored if x present)

y_in in optional

y-position (as y parameter; ignored if y present)

xrange in optional

Overrides !x.crange

yrange in optional

Overrides !y.crange

xlog in optional

Use with xrange to specify logarithmic axis. If xrange is not specified, reads from !x.type

ylog in optional

Use with yrange to specify logarithmic axis. If yrange is not specified, reads from !y.type

Examples

plot, [0], xrange=[-10, 20], yrange=[10, 15]

print, ajs_plot_pos(0.5)

5.0000000

print, ajs_plot_pos(0.5, 0.8)

5.0000000 14.000000

print, ajs_plot_pos(y_in=0.8)

14.000000

print, ajs_plot_pos([0.3, 0.5, 0.7], [0.2, 0.4, 0.6])

-0.99999964 5.0000000 11.000000

11.000000 12.000000 13.000000

print, ajs_plot_pos(y_in=0.8, yrange=[0.1, 0.2])

0.180000

print, ajs_plot_pos(y_in=0.5, yrange=[1, 100], /ylog)

10.0000

Author information

History:

30 Apr 2008 Written, Anthony Smith

File attributes

Modifcation date: Fri Jun 6 08:19:26 2008
Lines: 122
Docformat: rst rst