Rectangle GraphicHello everybody,
is there an easy way in JMP to generate a graph with different rectangles (different sizes)? See an example attached.
With this graph I would like to give an overview of different materials and their corresponding shapes.
Thanks in advance.
Johannes
Data TableGraphicsRe: Rectangle Graphic What sort of data do you have? You can for example create custom shape files
Re: Rectangle GraphicI attached a file with sample data. I do have coordinates for every corner of the rectangles.
Re: Rectangle GraphicJMP has a complete set of graphic primitives' that can be used for creating things such as rectangles. The Scripting Index details the functions available and gives examples of their use.


Here is the script from the Rect() function description.
Names Default To Here( 1 );
New Window( "Example",
Graph Box(
Pen Color( "Green" );
Pen Size( 2 );
Fill Color( "Red" );
Rect( 15, 75, 65, 55, 1 );
Rect( 10, 80, 70, 50 );
)
);
Re: Rectangle GraphicLots of overlap in your data. This code will do it; I set the rectangles to unfilled to show the overlap.
dt = data table("Rectangles");
// Set some constants
xmin = 0;
xmax = 4000;
ymin = 0;
ymax = 1500;
xres = 800;
yres = 500;
color_list = {"Red", "Blue", "Green", "Orange", "Purple"};
filled_rect = 0; // set to 1 for filled rectangles
heat_map_win = New Window( "Example Rectangles ",
rect_gb = Graph Box(
framesize( xres, yres ),
xscale(xmin, xmax),
yscale(ymin, ymax),
for (i = 1, i <= nrows(dt), i++,
xleft = dt:x 1[i];
xright = dt:x 3[i];
ybottom = dt:y 1[i];
ytop = dt:y 4[i];
pcolor = color_list[dt:material[i]];
pen color(pcolor);
fill color(pcolor);
rect(xleft, ytop, xright, ybottom, filled_rect);
),
)
);

Re: Rectangle GraphicAlso look at the transparency command if you have issues with which one is in front.
both rectangles are drawn with 50% alpha