cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

Draw Polygon on chart and get coordinates question

I have a bivariate chart with x/y coordinates. 

I can draw a polygon (which I think is Add Polygon Annotation) and then script the chart to find out the polygon's coordinates.  Problem is: they are not the coordinates of the chart's x/y axis.  Rather they seem to be coordinates of its polygon coordinate system, maybe like pixels or something like this.

Question: is there anyway to draw/freehand a polygon over a chart and get the polygon's coordinates in terms of those of the chart's x/y coordinate system?

 

thanks, DJ

1 REPLY 1
gzmorgan0
Super User (Alumni)

Re: Draw Polygon on chart and get coordinates question

@djhanson,

The graphic created by Add Polygon Annotation seems to be added to the PictureBox object and the values in the save script are units of pixels. An approximation of the X and Y coordinates can possibly be made by:

  • getting the pixels of the polygon
  • getting the size of the PictureBox
  • getting the size of each AxisBox, and maybe the FrameBox
  • getting each axis's settings (Min, Max, Inc)
  • compute the relative values.

That said, once I calculated that, I would remove the Polygon Annotation and add a graphics script to the FrameBox that draws a polygon using the approximated coordinates. 

 

Other methods would be to add a button to the report that draws an editable polygon. This would require callback functions using a MouseBox or Handle or something like that. There are other call back methods that I can imagine.

 

I don't have time at the moment to take a stab at either method. But maybe another community member has a solution.

 

It would be useful to know how you intend to use these coodinates.

Recommended Articles