Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Need help getting (x,y) boxes drawn from data

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 5, 2017 5:50 AM
(3905 views)

I have a column with numeric X values and another with numeric Y values. The X and Y values each contain a minimum and maximum value for a series of observations, such as

obs dimension min/max value

1 X min 1.1

1 X max 1.5

1 Y min 0.9

1 Y max 1.25

I have 5-10 observations, each with coordinates like these. I would like JMP to draw rectangles on an (x,y) plane with those coordinates. Can anybody tell me how to do this?

Thanks.

3 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is an example of taking your data and drawing a rectangle

```
Names Default To Here( 1 );
dt = New Table( "Untitled 18",
Add Rows( 4 ),
New Column( "dimension", Character, "Nominal", Set Values( {"X", "X", "Y", "Y"} ) ),
New Column( "min/max", Character, "Nominal", Set Values( {"min", "max", "min", "max"} ) ),
New Column( "value", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1.1, 1.5, 0, 1.25] ) )
);
dtSplit = dt << Split( Split By( :dimension, :Name( "min/max" ) ), Split( :value ), Sort by Column Property );
New Window( "Example",
Graph Box(
Y Scale( 0, 4 ),
X Scale( 0, 4),
Pen Color( "Green" );
Pen Size( 2 );
For( i = 1, i <= N Rows( dtSplit ), i++,
Rect( dtSplit:X min[i], dtSplit:Y max[i], dtSplit:X max[i], dtSplit:Y min[i], 0 )
);
)
);
```

The Graph Box functions are all documented at:

Help==>Scripting Index==>Graph Box

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

There is very good documentation on Creating Maps in the Essential Graphing guide:

Help==>Books==>Essential Graphing

In JMP 13 it is Chapter 15, starting on page 303

I suspect your issue is placing the map on your desktop and getting JMP to be able to find it there. In my use of these maps, I always place them in the AutoLookup folders, and documented in the Essential Graphing guide

Help==>Books==>Essential Graphing

In JMP 13 it is Chapter 15, starting on page 303

I suspect your issue is placing the map on your desktop and getting JMP to be able to find it there. In my use of these maps, I always place them in the AutoLookup folders, and documented in the Essential Graphing guide

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

What I suspect that is going on, is that you are not defining the 4 points of your rectangle properly. Since with a Shape Map, what you are really defining are polygons, they must be defined in a continuous order. i.e. (top,left), (top,right), (bottom,right), (bottom,left).

Jim

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is an example of taking your data and drawing a rectangle

```
Names Default To Here( 1 );
dt = New Table( "Untitled 18",
Add Rows( 4 ),
New Column( "dimension", Character, "Nominal", Set Values( {"X", "X", "Y", "Y"} ) ),
New Column( "min/max", Character, "Nominal", Set Values( {"min", "max", "min", "max"} ) ),
New Column( "value", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1.1, 1.5, 0, 1.25] ) )
);
dtSplit = dt << Split( Split By( :dimension, :Name( "min/max" ) ), Split( :value ), Sort by Column Property );
New Window( "Example",
Graph Box(
Y Scale( 0, 4 ),
X Scale( 0, 4),
Pen Color( "Green" );
Pen Size( 2 );
For( i = 1, i <= N Rows( dtSplit ), i++,
Rect( dtSplit:X min[i], dtSplit:Y max[i], dtSplit:X max[i], dtSplit:Y min[i], 0 )
);
)
);
```

The Graph Box functions are all documented at:

Help==>Scripting Index==>Graph Box

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Need help getting (x,y) boxes drawn from data

Thank you, that does what I want. I was also thinking I might want to do this via creating a custom map, but I can't seem to get that to work. I follow the example in the sample help file but I keep getting the message in graph builder that the shape file is not found. I created the -Name and -XY files with the same shape ID column. In the -NAME file I assigned the shape name definition role to the name of my shape(s). I then created a new file with those names and some data and assigned the shape name use role to the column with the names - I put both the -NAME and -XY files in a new folder on my desktop and pointed to that folder in the shape name use role to tell JMP where to find the files.

I must be missing something - possibly where the paths to the files since I put them in a folder on my desktop. If anyone has any idea how I may be going wrong, I'd appreciate some tips.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Help==>Books==>Essential Graphing

In JMP 13 it is Chapter 15, starting on page 303

I suspect your issue is placing the map on your desktop and getting JMP to be able to find it there. In my use of these maps, I always place them in the AutoLookup folders, and documented in the Essential Graphing guide

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Need help getting (x,y) boxes drawn from data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

What I suspect that is going on, is that you are not defining the 4 points of your rectangle properly. Since with a Shape Map, what you are really defining are polygons, they must be defined in a continuous order. i.e. (top,left), (top,right), (bottom,right), (bottom,left).

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Need help getting (x,y) boxes drawn from data

Excellent! Thank you so much this is a perfect solution.