2種類の行を持つ座標系列があります。データは3つの列、列1(x座標)、列2(y座標)、およびタイプに格納されています。
二変量解析でプロットし、両方の座標グループを楕円で囲んだ後、各グループの中心に、各座標グループの重心を示すマーカーを追加したいと思います。マーカーの色は、できれば「Type」列で指定された色と一致させるのが望ましいです。
プロットの下の統計情報に必要な値、つまり各グループの列1の平均と列2の平均は確認できますが、色付きマーカーを使ってそれらをプロットに追加する方法がわかりません。下の画像では、テキストとして手動で2つの「+」を追加しましたが、複数のグループで何度も試す必要がある場合は面倒です。

こんな感じかな
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>
Links:
xpath: <A href="https://community.jmp.com/t5/Discovery-Summit-2015/JMP-Discovery-2015-Mining-JMP-Reports-v10-pdf/m-p/22595#U22595" class="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa" target="_blank">JMP Discovery 2015 - JMP レポートのマイニング - v10.pdf</A> and <A href="https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326500/highlight/true#M57581" target="_blank">これです</A>
ellipse: <A href="https://community.jmp.com/t5/Uncharted/Ellipse/m-p/21242#U21242" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">楕円</A>
XML: <A href="https://community.jmp.com/t5/Uncharted/Open-an-RSS-Feed-in-JMP/m-p/239296#U239296" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">JMPでRSSフィードを開く</A> , <A href="https://community.jmp.com/t5/Uncharted/Contour-Plot-Areas/m-p/294516#U294516" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">等高線プロット領域</A> , <A href="https://community.jmp.com/t5/Uncharted/Currency-Exchange-Rates/m-p/240876#U240876" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">為替レート</A> , <A href="https://community.jmp.com/t5/Uncharted/SQL-for-Cord-Cutters/m-p/238656#U238656" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">コードカッターのためのSQL</A>
<BR />
私の頭の中では次のようになります:
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" )}
);
ただし、この解決策では、グループごとにマーカーを 1 つ追加する必要があります。
「タイプ」列に含まれるすべてのグループのすべてのマーカーを追加する方法はありますか?
分析で使用される同じカラーテーマを使い続けるにはどうすればよいですか?
しかし、これは私のニーズに対する単純な例です。通常、視覚化に追加する必要がある重心は数十個あります。実際の分析では、重心をプロットする必要があるカテゴリの数が多いため、すぐに面倒になります。
テーブルに手動で行を追加せずに、そのような座標を追加する方法があるかもしれません。
手動によるプロットを避けて、タイプ分析によって計算された平均値をグラフ化する方法はありますか?
あるいは、グラフ ビルダーでも、行 (マーカー) を手動で追加しなくても済む限り、問題にはなりません。
データテーブルに、重心の座標と種類を2つの新しい行として追加するだけです。行の状態を「除外」、色を赤または青、マーカーを「+」に変更します。