我有一系列具有两种类型行的坐标。 数据分为三列:Column1(x 坐标)、Column2(y 坐标)和 Type。
在我将它们绘制在双变量分析中并在两组坐标周围绘制一个椭圆之后,我想在每组的中心添加一个标记,标记每组坐标的质心。 标记最好与“类型”列确定的颜色相匹配。
我可以在图下方的统计信息中看到我需要的值,它是每组的 Column1 和 Column2 的平均值,但我不知道如何使用彩色标记将它们添加到图中。 对于下面的图片,我手动添加了两个“+”作为文本,但是当我需要多次尝试使用多个组时它会变得很痛苦。

也许是这样的
Seemed easier to find the markers on a black background.Seemed easier to find the markers on a black background.似乎更容易在黑色背景上找到标记。
// this is an imperfect solution; the added marker color and position is static and
// will not respond to changes. It also depends on the organization of the displayboxes
// in the report.
oldpref = getpreference(Continuous Color Theme( )); // remember the old color pref
setpreference(Continuous Color Theme( "Spectral" )); // set a more obvious color change
bc=open("$sample_data/big class.jmp");
// make a graph with density ellipses for each age
bv = bc<<BIVARIATE>="15",
elname = elOutline << gettitle; // "Bivariate Normal Ellipse P=0.950 age==17"
// that same ellipse name appears above, with a color swatch. get the color.
query = Eval Insert( "//TextEditBox[text()[contains(.,'^elname^')]]" );
// the query is the label to the right of a popup and the color.
// .. moves up to the parent; the CustomBox child holds the color
customBoxColor = bv << xpath( query || "/../CustomBox" );
// extracting the color from the popupbox legend: write to svg
(customboxcolor) << savepicture( "$temp/color.svg", "svg" );
// read the svg text
svgblob = Load Text File( "$temp/color.svg", blob() );
// parse the svg text to a data table, just grab the color
dt = Open( svgblob, invisible, // I uses the XML wizard to generate this code.
XML Settings( Stack( 0 ), Row( "/svg/g/g/g" ), // SVG *is* XML
Col( "/svg/g/g/g/@stroke", Column Name( "color" ), Fill( "Use Once" ), Type( "Character" ), Format( {"Best"} ), Modeling Type( "Continuous" ) )
), XML Wizard( 0 ) );
// the data table's color column (and only row) is the color
elColor = Substr( dt:color[1], 2 ); // "#8E95D5", drop the #
close(dt,nosave); // don't leave the invisible table open
// convert the hex to a JSL color
elColor = rgbcolor(Hex To Number( Substr( elColor, 1, 2 ) ),Hex To Number( Substr( elColor, 3, 2 ) ),Hex To Number( Substr( elColor, 5, 2 ) ));
, // else JMP 14 has no XML
elColor = rgbcolor(1,1,1); // white, opposite of background color, black
);
// next, get the coordinates of the mean
// minimal validation we are looking at the right column...
if( elOutline[NumberColBox(1)]<<GETHEADING></GETHEADING></BIVARIATE>链接:
路径: JMP Discovery 2015 - 挖掘 JMP 报告 - v10.pdf和这个
椭圆:椭圆
XML:在 JMP 中打开 RSS 源,等高线图区域,货币汇率,剪线钳的 SQL
在我看来,它看起来像这样:
Marker Size( 6 );
Marker(
1,
{Col Mean( :Column 1, :Type == "Type1" ),
Col Mean( :Column 2, :Type == "Type1" )}
);
Marker(
1,
{Col Mean( :Column 1, :Type == "Type2" ),
Col Mean( :Column 2, :Type == "Type2" )}
);
然而,该解决方案仍然需要为每组添加一个标记。
有没有办法可以为“类型”列中包含的所有组添加所有标记?
如何继续使用分析中使用的相同颜色主题?
然而,这是我需要的一个简单示例。 通常我会有几十个需要添加到可视化中的质心。 在我的真实分析中,由于我需要绘制质心的可能类别的数量,它变得太痛苦了。
也许有一种方法可以添加此类坐标,而无需手动将行添加到我的表中。
有没有办法绘制由类型分析计算的平均值以避免手动绘图?
或者甚至在 Graph Builder 中,这并不重要,只要它避免手动添加行(标记)即可。
只需将质心的坐标和类型添加为数据表中的两个新行。 将它们的行状态更改为已排除、红色或蓝色以及“+”标记。