嗨,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。