cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
statcon
Level II

Adding Points to a graphbox

Hi,

i created an interaktive graph. Now i need to add points (or more general: geometric shapes) to the graphbox.

This should be done on a mousklick using MouseTrap().

I thought of soemthing like that:

// Ad a marker to the graph at the position where the mouse was pressed

::click = function({x,y},

  ::g << Marker(MarkerState(3), x, y);

  ::g << Circle(x, y, PixelRadius(10));

);

::w = New Window("Test",

  // Some other components (Textboxes...)

  ::g = Graph Box(

                    FrameSize( 300, 300 ),

                    Mousetrap( ::click( x, y ), {} )

          )

);

But sadly this does not work. Is there a way to do something like that?

Thanks for any hints!

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Adding Points to a graphbox

A couple of points:

- coordinates are typically expressed in a list or matrix format

- the graphical functions operate within a graphics script

The following should work:

::click = function({x,y},

               pos = {};

               InsertInto(pos,x);

               InsertInto(pos,y);

       ::g[FrameBox(1)] << Add Graphics Script(

                        Marker(Marker State(3), pos) ;

                         Circle(pos, PixelRadius(10));

               )

);

-Dave

-Dave

View solution in original post

2 REPLIES 2
David_Burnham
Super User (Alumni)

Adding Points to a graphbox

A couple of points:

- coordinates are typically expressed in a list or matrix format

- the graphical functions operate within a graphics script

The following should work:

::click = function({x,y},

               pos = {};

               InsertInto(pos,x);

               InsertInto(pos,y);

       ::g[FrameBox(1)] << Add Graphics Script(

                        Marker(Marker State(3), pos) ;

                         Circle(pos, PixelRadius(10));

               )

);

-Dave

-Dave
statcon
Level II

Adding Points to a graphbox

Thanks it works exactly as i need it!

Recommended Articles