矩形图形大家好,
JMP 中是否有一种简单的方法来生成具有不同矩形(不同大小)的图形? 请参阅附加的示例。
通过这张图,我想概述不同的材料及其相应的形状。
提前致谢。
约翰内斯
数据表图形回复:矩形图形你有什么样的数据? 你可以例如创建自定义形状文件
回复:矩形图形我附上了一个带有示例数据的文件。 我确实有矩形每个角的坐标。
回复:矩形图形JMP 有一套完整的图形基元,可用于创建诸如矩形之类的东西。脚本索引详细说明了可用的函数并给出了它们的使用示例。


这是来自 Rect() 函数描述的脚本。
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 );
)
);
回复:矩形图形您的数据中有很多重叠。这段代码会做到;我将矩形设置为未填充以显示重叠。
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);
),
)
);
