Simon Gibbon wrote:
> Having used plot to produce a range of graphics, I am now trying to add
> extra features interactively to the plots produced computationally i.e.
> clicking on the plot working out the co-ordinates and then adding a line or
> text to the existing plot without redrawing it.  Having I think read the
> excellent plot documentation I feel I am still missing something and would
> appreciate pointing the right direction.
> So my simplistic method is to tie a function to the right mouse button, this
> is demonstrated in the routine "testplot_plotspace_mbrdown" in the example
> code below.   This code draws a plot with a straight line and then when you
> right click on the graph it plots a vertical line where you have clicked.
>  However, this a hack having discovered the variables I need (XMIN, XMAX,
> YMIN, YMAX), not from the documentation but from looking at the namespace.
> 
> So I have 3 questions:
> 1 is this a sensible way to do such interactive plotting (simple way),

Sounds reasonable to me. These issues are still on the todo list, and
hence are not well documented.

> 2 Gxywh, Sxywh etc are well documented in the Wiki under the Plot / Layout
> Calculation page is there another similar variable which reports the user
> units of the maximum X and Y used in the actual plot as the XRANGE variable
> is the range of the data not the range over which the data is plotted.

I believe the values you are looking for are YMin and YMax.

> 3 is there a way to swap between YAXIS and Y2AXIS, as I would like to be
> able to get x and y user co-ordinates back from either scaling, currently it
> appears to lock the axis scaling (ymin, ymax) to the Y2AXIS as the last one
> used.

Good point, the second y axis overwrites globals created for the first,
and there is no way to recover them. It would be better to create a
second set of globals for the second axis.

Incidentally, this should have been posted to the programming forum,
thanks. General is for announcements, installation issues etc. See
http://www.jsoftware.com/jwiki/System/Forums .
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to