你好
嘗試反白雙變量圖中特定行的標記。
我手動建立了繪圖並將其儲存到腳本窗口,並手動選擇「主題」列作為行圖例。
但問題是,當我查看腳本時,我沒有在腳本中看到上述步驟!
這就是我的意思
dt = Open( "$sample_data/Hollywood Movies.jmp" );
dt = currentdatatable(); // Don't know I need this here anyway
Bivariate(
Y( :Domestic Gross ),
X( :Foreign Gross ),
Fit Where( :Genre == "Action", Fit Line( {Line Color( {212, 73, 88} )} ) ),
Fit Where(
:Genre == "Adventure",
Fit Line(
{Line Color( {61, 174, 70} )},
{Set α Level( 4.06068261874589e-315 )}
)
),
Fit Where( :Genre == "Animation", Fit Line( {Line Color( {66, 112, 221} )} ) ),
Fit Where( :Genre == "Comedy", Fit Line( {Line Color( {204, 121, 41} )} ) ),
Fit Where( :Genre == "Drama", Fit Line( {Line Color( {40, 182, 143} )} ) ),
Fit Where( :Genre == "Fantasy", Fit Line( {Line Color( {162, 43, 221} )} ) ),
Fit Where( :Genre == "Horror", Fit Line( {Line Color( {196, 189, 43} )} ) ),
Fit Where( :Genre == "Romance", Fit Line( {Line Color( {39, 174, 174} )} ) ),
Fit Where( :Genre == "Thriller", Fit Line( {Line Color( {197, 41, 201} )} ) ),
SendToReport( // What does this mean here ? Why we need this ?
Dispatch( // What does this mean here ? why we need this ?
{},
"Bivar Plot",
FrameBox,
{Frame Size( 377, 299 ), Row Legend(
Theme,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);這創造了

我想要做的是控制哪一列作為行圖例並突出顯示該列中的行。 像這樣的東西

我確信手冊中不存在這一點。
Names Default To Here( 1 );
dt = New Table( "Example",
Add Rows( 15 ),
New Column( "sex",
Character,
"Nominal",
Set Values(
{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "M", "M", "M",
"M"}
)
),
New Column( "height",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values( [59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59] )
),
New Column( "weight",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values(
[95, 123, 74, 145, 64, 84, 128, 79, 112, 107, 67, 98, 105, 95, 79]
)
),
Set Row States(
[192, 193, 193, 193, 193, 32833, 32833, 32832, 192, 192, 192, 32832, 32832,
32832, 32832]
)
);
// Here is the Bivariate Platform. It will honor the rowstates
// I have provided some selections, etc. but you can change them
// to whatever selections you want
Bivariate(
Y( :height ),
X( :weight ),
Fit Where( :sex == "F", Fit Line( {Line Color( "Medium Dark Red" )} ) ),
Fit Where( :sex == "M", Fit Line( {Line Color( "Medium Dark Blue" )} ) )
);
// Here is the code to create the new rowstate column
// But it can easily be done manually by just creating a new
// column, and then going to the Col Info window, and setting the
// data type to Row State
dt << New Column( "The RowStates", rowstate );
// This is the command that copies the rowstates from the
// rowstate column, to the new column called The RowStates<BR />// To do this interactively just go to the column panel and<BR />// right click on the red star in front of the new column<BR />// and select "Copy From Rowstates"
dt:The RowStates << copy from rowstates;
// dt:The RowStates << Hide(1); // This will hide the column from view
// The rest is manual(interactive);
// Go to the red triangle on the Bivariate output and select
// Save Script==>To Data Table
// Once it is saved, Go to the green triangle in front of the script that was just
// saved to the data table. Right click on the green triangle and select Edit
// Now add the following line as the first line
// :The RowStates << Copy to Row states;
// Make sure you remove the // from the front of the line
// Now, whenever you run the script, the row states from when you created the graph
// will be applied before the graph is created感謝您的長解釋。 確實非常有幫助。 我喜歡這個部分“您認為是圖表突出顯示了點(標記)。但可惜的是,控制突出顯示的是數據表。 」 這是一個很好的解釋。
OTH,第 2 項的問題如何做到這一點? 對於擁有多年經驗的你來說,只需一秒鐘即可將其寫入 jsl,但對於我來說,需要一周的時間才能找出你的真正含義或如何付諸實踐。 我希望您發布一些腳本來展示您的思考過程,這樣也許其他人也能從中受益;)
繪圖上特定標記(點)的突出顯示以及其餘標記的隨後淡出實際上連結到資料表,以及在資料表中選擇了哪些行。 如果您轉到具有根據其列建立的雙變量散佈圖的資料表,並選擇資料表中的一行,則雙變數圖中的點將突出顯示,所有其他點將變淡。這種在資料表中選擇行並在與資料表關聯的所有圖表中突出顯示該行的行為是 JMP 的主要原則之一。因此,當您單擊圖表中的特定圖例或圖表中的一組點(標記)時,您看到的行為實際上並沒有指示圖表突出顯示這些點,但實際上,它是告訴數據表選擇數據表中的特定行,然後資料表中的該操作告訴所有相關圖形突出顯示圖形中表示所選行中的資料的點。這種行為從 JMP 一開始就存在。現在,我為什麼要花那麼多時間來告訴你這些。好吧,您對不理解為什麼突出顯示的數據點沒有在保存的腳本中捕獲的描述向我暗示,您認為是突出顯示點(標記)的圖表。但可惜的是,控制突出顯示的是數據表。也就是說,使圖表具有所需突出顯示的一種方法是選擇資料表中需要選擇的行來製作突出顯示標記,然後儲存資料表。資料表中的行選擇將被儲存,當開啟並執行圖形腳本時,它將根據需要顯示圖形。這通常不是選擇的解決方案。處理要突出顯示的標記的其他三種方法通常是更好的選擇。
- 手動將程式碼新增至腳本中,專門選擇所需的行;
- 建立資料類型「rowstate」的新列,根據需要設定資料表選擇、標記等,以便按照您想要顯示的圖形顯示,然後將 Rowstates 儲存到新列行狀態列。然後,您要做的就是在已儲存的腳本中新增語句,將所需的行狀態值從行狀態列複製回資料表的行狀態,然後產生圖形。
- 使用本地資料過濾器進行行選擇。本地過濾器不會物理選擇資料表中的行。相反,它為特定平台提供了一個虛擬選擇環境,就像在資料表本身中進行選擇一樣。本機資料過濾器會儲存在已儲存的腳本中。
我希望這是有道理的。如果您還有更多問題,請詢問他們。