用變數擬合樣條曲線嘿,
我建立了一個帶有動態圖例的圖表,使用者可以透過單選框進行選擇。
使用者選擇的圖例名稱儲存為“L1”變數。
我想新增一項功能,當使用者點擊圖例中的一個值時,該值的樣條線會變得更加粗體。
我向文件添加一個狀態處理程序並嘗試使用此腳本:
rsh1 = test1 << Make Row State Handler( dt, rsupdate1 );
rsupdate1 =function({},
SplineSelectlist=dt:L1[dt<<GET selected="" rows=""></GET>
「適合位置」狀態無法辨識該變數。
我還嘗試使用“parse”或不使用“eval”或在之前定義變數-
mycolumn= eval(L1);
但它們都不起作用。
我很高興聽到是否有解決方案。
謝謝。
回覆:用變數擬合樣條曲線@vsr ,你的任務不同於@四郎的任務。@四郎需要以不同的方式擬合樣條線價值觀一列的。
看我提供的範例,顯示的曲線對於不同的情況是不同的價值觀的:狀態。
從你的描述來看,你似乎想要不同的列,不是一列的不同值。 Fit 在哪裡選擇價值觀所選列的。 如果沒有更多關於您具體想要做什麼的細節,我只能猜測。
我的猜測是,您可能想要繪製不同的 Y 或不同的 X,即列。 如果是這種情況,JMP 有一個內建解決方案,稱為列切換器。以防萬一,這就是您所需要的,我提供了範例螢幕截圖和腳本。如果這不是您所需要的,請提供更多詳細資訊。

Names Default to Here(1);
dt = Open("$sample_data/TechStock.jmp");
biv = dt << Bivariate(
Y( :Name( "Adj. Close*" ) ),
X( :Date ),
Fit Spline( 10, {Line Color( {212, 73, 88} )} ),
Column Switcher(
:Name( "Adj. Close*" ),
{:Open, :High, :Low, :Close, :Name( "Adj. Close*" )}
)
);
//select a Y column one at a time or select the "play/go" button and JMP will cycle thru all columns回覆:用變數擬合樣條曲線你好,
我想加入最初的查詢,因為我遇到了類似的問題。
我正在嘗試建立一個“圖例選擇器按鈕”,其中每個值都是一個列名稱。
當選擇一個值時,傳奇和樣條線我的雙變數 x/y 圖的將根據所選值進行更新(先前的圖例和樣條線將被刪除)。
但是,我不知道如何調整“適合位置”功能來接收多變的作為輸入(變數是所選列名稱),如原始查詢中所述。
謝謝,哈達爾
回覆:用變數擬合樣條曲線由於沒有提供更多信息,我猜測您需要什麼。 也許您只需要使用 和 表達式來製作樣條語句。該腳本允許選擇一個或多個圖例值。 它用:
- 用於管理圖例選擇的不可見匯總表的預設連結。 當二元變數關閉時,這個不可見的表格也隨之關閉。
- 行狀態處理程序函數,用於清除先前的樣條線並僅顯示從圖例中選擇的樣條線。
- 它已在 JMP14.1 和 JMP13.21 上進行了測試。

Names Default to Here(1);
dt0 = Open("$sample_data/SATByYear.jmp");
//create a smaller table too many groupings
dt0 << Select Where( :Region=="Plains" | :Region=="South");
dt = dt0 << Subset(All Columns, Output Tablename("SomeStates"));
close(dt0,NoSave);
//change Year from Ordinal to Continuous to create a Bivariate report
dt:Year << Set Modeling Type("Continuous");
//The legend column is hardcoded. It seemed like you know how to do that.
//I created a new column just for interest
gCol = dt << New Column("Region_State", character);
gcol << set each value( substr(:Region,1,1) || "_" || :State);
dt << Color by Column(:Region);
//Create the Bivariate report
biv = dt << Bivariate( Y(:SAT Math), X(:Year) );
//Add a row legion for the legend column. For your script you woudl have to remove the
//previous legend and add a new one.
rbiv = Report(biv);
fb = rbiv[FrameBox(1)];
//You would likely change both color and symbol, just made it different for interest
fb << Row Legend(:Region_State, color(0), Marker(1));
//It will be easier to create the Spline with a By group. The Summary table simplifies the task.
sumdt =dt << Summary(Group(:Region_State), Invisible);
//if the biv winow is closed/ close summary table
biv << On Close (Close(sumdt, NoSave)); //closes the summary table and row state handler
//Create a row state handler function, that defines the tasks when rge rowstate of sumdt changes.
f = Function({a},
_c = biv << Xpath("//IfBox[@isTrue='true']");
for(i=nitems(_c), i>=1, i--, biv << (curve[i] << Remove Fit) );
_yy = sumdt << get selected rows();
if(nrow(_yy)>0,
_xx = (sumdt:Region_State<<GET values=""></GET>
回覆:用變數擬合樣條曲線這裡沒有足夠的資訊來回應,並且存在一些語法問題。
圖表是否已經繪製了樣條線並且您希望突出顯示所選項目?
您使用的是 GraphBuilder 還是 Bivariate(透過 X 擬合 Y)?
:eval(L1) 不是正確的語法。