親愛的,
我想知道是否以及如何始終根據特定標準(例如,在以下基於季度的情況下)擁有固定的線條樣式/顏色。
如果您採用樣本數據文件“澳大利亞旅遊”並繪製客房入住率 (%) 與年份的關係圖,您將得到如下所示的內容,
我將第 2 季度的線條樣式更改為虛線。

但是,當我僅選擇第 2、3 和 4 季度時,圖表變為:

我想讓第 2 季度仍然是紅色虛線,第 3 季度仍然是全綠色,第 4 季度仍然是全紫色。
當我開始尋找解決方案時,我最終來到了這個頁面:
customization - 在 JMP 中,如何通過指定曲線名稱來自定義圖形線? - 堆棧溢出
它看起來很有希望,但不知何故它似乎對雙變量圖有效,我無法將此技巧應用於 Graph Builder 圖。
誰能幫我改變線條風格?
我會想像下面這樣的東西,但它似乎不起作用。
dt = Open( "$SAMPLE_DATA/Australian Tourism.jmp" );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :Year ),
Y( :Name( "Room occupancy rate (%)" ) ),
Overlay( :Quarter )
),
Elements(
Line( X, Y, Legend( 7 ), Row order( 0 ), Summary Statistic( "Mean" ) )
),
SendToReport(
Dispatch( {}, "Year", ScaleBox, {Show Major Ticks( 0 )} ),
Dispatch(
{},
"Room occupancy rate (%)",
ScaleBox,
{Min( 54.5305429864253 ), Max( 75 ), Inc( 5 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 7, Properties( 3, {Line Style( "Dashed" )} ) )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Room occupancy rate vs. Year and Quarter" )}
)
)
);
reportWindow = gb << Report;
reportWindow[ ScaleBox ] << (Line[1] << Line Style( Dashed ));我的想法是查看腳本,更改線條樣式會向“ScaleBox”發送一些內容。
但是我做錯了什麼,因為它不工作而且日誌文件告訴我:
Send Expects Scriptable Object in access or evaluation of 'Send' , reportWindow[ScaleBox] << /*###*/(Line[1] << Line Style( Dashed )) /*###*/
在以下腳本中,錯誤標記為 /*###*/
reportWindow[ScaleBox] << /*###*/(Line[1] << Line Style( Dashed )) /*###*/
謝謝,
這已經是一個很大的幫助,而且應用起來確實非常簡單。
可以對線型做類似的事情嗎?例如虛線、實線等。
最好的祝福,
皮特。