嗨,JMP社区,
与图形脚本命令“圆”,“椭圆”和“矩形”相似,是否可以在FrameBox中插入自定义的形状,图标或图片?
值得注意的是,我不是寻找自定义数据点标记。
这是我正在使用的图形脚本类型的摘要(gb是图形构建器热图),在这里我想用自定义形状替换Circle:
gbr = report (gb);
fb = gbr [FrameBox (1)];
fb << add graphics script (
Fill color (black);
For (i = 0, i <= 24, i++,
For (j = 0.5, j <= 7, j = j+2,
r = (i*8) + (j+0.5);
s = column (dt,"SIZE FDR") [r] / 8;
if (s < 0.02, s = 0.02);
circle ({i,j}, s, "FILL")
)
);
);
感谢您的帮助。
最好的,
TS
path()函数?
https://community.jmp.com/t5/Discussions/Bezier-interpolation/mp/257852#M50666
和使用Path()的贝塞尔曲线树(脚本脚本索引可能具有更简单的非贝济耶例子。)
列属性UseForMarker也可用于图片列,但听起来您可能没有每个标记的数据点。
我认为没有UseForMarker的唯一获得图片或图标的方法是为每个标记分别创建图片段。 可以逐段定位它们。
N点星
makestar = Function( {x, y, npoints, inside, outside},
{p = J( 2 * npoints, 3, . ), angle, i, move = 1, draw = 2},
For( i = 1, i < N Rows( p ), 0,
angle = 2 * Pi() * i / N Rows( p );
p[i, 1] = x + Sin( angle ) * inside; // sin and cos are reversed here to
p[i, 2] = y + Cos( angle ) * inside; // make the point be at the top.
p[i, 3] = If( i == 1, move, draw ); // swap sin/cos for point at left.
i += 1;
angle = 2 * Pi() * i / N Rows( p );
p[i, 1] = x + Sin( angle ) * outside; // ditto
p[i, 2] = y + Cos( angle ) * outside;
p[i, 3] = If( i == N Rows( p ), -draw, draw );
i += 1;
);
p; // return
);
New Window( "Example",
gb = Graph Box(
xaxis( Show Major Grid( 1 ) ),
yaxis( Show Major Grid( 1 ) ),
framesize( 500, 500 ),
Pen Color( "red" );
Pen Size( 3 );
Fill Color( "blue" );
npoints = 3; // each star gets more points below
For( xx = 20, xx <= 80, xx += 20,
For( yy = 20, yy <= 80, yy += 20,
// the inside/outside ratio needs to change with more points...
p = makestar( xx, yy, npoints, 2 + npoints / 4, 8 );
Path( p, 1 ); // blue solid fill
Path( p, 0 ); // red outline
npoints += 1;
)
);
)
);
// move the grid lines above the stars
grid = gb[framebox( 1 )] << find seg( SegPlaceholder( 1 ) );
// grid is the original, below the stars
gb[framebox( 1 )] << appendseg( grid ); // makes a copy above
// probably not needed...they are on top of each other...
grid << delete; // delete the original from below
还有一个PixelPath()功能。 如果遇到性能问题(可能有数千个点),PixelPath允许重新定位,调整大小和旋转现有路径。 (我不知道该怎么做小路() 。)您可以预先创建一次星形,然后将其与PixelPath一起使用。
拉伸图形时,Path()和PixelPath()的行为有所不同:Path会绘制用户坐标,并且会拉伸以适合当前轴。 PixelPath会绘制像素,并且符号不会更改大小。
脚本编制索引提供了PixelPath的示例;使用PixelOrigin(x,y)并将h,v保留为0,0。