分組圖形的X軸寬度可以單獨設定嗎?例如我這樣畫完圖之後,這兩個x軸的寬度就設定不一樣了。
謝謝!
dt=Open("$SAMPLE_DATA/Big Class.jmp");
d2=dt<<SUMMARY></SUMMARY>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><span class="lia-inline-image-display-wrapper" image-alt="2025-05-01_11-07-14.png" style="width: 729px;"><img src="https://us.v-cdn.net/6038925/uploads/images/75382i47576C683FBC176C/2025-05-01_11-07-14.png" role="button" title="2025-05-01_11-07-14.png" alt="2025-05-01_11-07-14.png" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P><LINGO-LABS id="lingo-labs-871238" slang="en-US" mode="CREATE"><LINGO-LABEL>自動化和腳本</LINGO-LABEL><LINGO-LABEL>視窗</LINGO-LABEL></LINGO-LABS>
Re: 分組圖形的X軸寬度可以單獨設定嗎?您可以將高度列分為兩部分:

....並產生 2 個相鄰的圖:
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Summary(
Group( :age, :sex ),
Sum( :height ),
statistics column name format( "column" )
);
New Column( "height M", Formula( If( :sex == "M", :height ) ));
New Column( "height F", Formula( If( :sex == "F", :height ) ));
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height F ), X( :height M ), Y( :age ), Color( :N Rows ) ),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y ) ),
Elements( Position( 2, 1 ), Bar( X, Y ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 )} )
)
);
不幸的是,劇情中的顏色出乎意料:男女都是同一種顏色? !
似乎顏色取自用於響應軸的列中沒有值的行。
-> 有趣/重要的發現!

Re: 分組圖形的X軸寬度可以單獨設定嗎?謝謝專家!
Re: 分組圖形的X軸寬度可以單獨設定嗎?因此,此外,分割顏色或年齡軸:

Graph Builder(
Transform Column( "age_F", Nominal, Formula( If( :sex == "F", :age ) ) ),
Transform Column( "age_M", Nominal, Formula( If( :sex == "M", :age ) ) ),
Size( 433, 323 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :height F ),
X( :height M ),
Y( :age_M, Combine( "Merged" ) ),
Y( :age_F, Position( 1 ), Combine( "Merged" ) ),
Color( :N Rows )
),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y( 2 )) ),
Elements( Position( 2, 1 ), Bar( X, Y( 1 ) ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 ), Inc( 100 ), Minor Ticks( 0 )} )
);
透過獨立縮放 x 軸的能力,您還可以獲得 2 個顏色尺度的有意義範圍(= 相同範圍)的「職責」。
Re: 分組圖形的X軸寬度可以單獨設定嗎?更好的方法:透過頁面
- 獨立的 x 軸
- synchronous y axis scale - via Link Page Axes( "Y Only" ),
- 同步色標
我希望你不介意情節之間的小差距

Graph Builder(
Size( 527, 455 ),
Show Control Panel( 0 ),
Link Page Axes( "Y Only" ),
Replicate Linked Page Axes( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables( X( :height ), Y( :age ), Page( :sex, Levels per Row( 2 ) ), Color( :N Rows ) ),
Elements( Bar( X, Y, Legend( 7 ) ) )
);
Re: 分組圖形的X軸寬度可以單獨設定嗎?這個寬度是一樣的。
Re: 分組圖形的X軸寬度可以單獨設定嗎?噢,是的,你是對的。範圍可以單獨調整,但寬度再次被強制相同。
那麼我擔心您需要冗長的程式碼。
讓我們看看其他用戶的建議...
Re: 分組圖形的X軸寬度可以單獨設定嗎?謝謝專家!
我正在使用這個腳本。
我們如何透過截取螢幕截圖、將滑鼠懸停在圖形上或點擊圖形來獲取此子集?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Summary(
Group( :age, :sex ),
Sum( :height ),
statistics column name format( "column" )
);
New Column( "height M", Formula( If( :sex == "M", :height ) ));
New Column( "height F", Formula( If( :sex == "F", :height ) ));
Graph Builder(
Transform Column( "age_F", Nominal, Formula( If( :sex == "F", :age ) ) ),
Transform Column( "age_M", Nominal, Formula( If( :sex == "M", :age ) ) ),
Size( 433, 323 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :height F ),
X( :height M ),
Y( :age_M, Combine( "Merged" ) ),
Y( :age_F, Position( 1 ), Combine( "Merged" ) ),
Color( :N Rows )
),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y( 2 )) ),
Elements( Position( 2, 1 ), Bar( X, Y( 1 ) ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 ), Inc( 100 ), Minor Ticks( 0 )} )
));
Re: 分組圖形的X軸寬度可以單獨設定嗎?我嘗試了這樣的程式碼,只有點擊左側的圖像「F」才能成功。
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d1=dt << Summary(
Group( :age, :sex ),
Sum( :height ),
statistics column name format( "column" )
);
New Column( "height M", Formula( If( :sex == "M", :height ) ));
New Column( "height F", Formula( If( :sex == "F", :height ) ));
p2=d1<< Graph Builder(
Transform Column( "age_F", Nominal, Formula( If( :sex == "F", :age ) ) ),
Transform Column( "age_M", Nominal, Formula( If( :sex == "M", :age ) ) ),
Size( 433, 323 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :height F ),
X( :height M ),
Y( :age_M, Combine( "Merged" ) ),
Y( :age_F, Position( 1 ), Combine( "Merged" ) ),
Color( :N Rows )
),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y( 2 )) ),
Elements( Position( 2, 1 ), Bar( X, Y( 1 ) ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 ), Inc( 100 ), Minor Ticks( 0 )} )
));
frame=(p2<
<REPORT></REPORT>
<P><SPAN><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><span class="lia-inline-image-display-wrapper" image-alt="2025-05-07_10-58-54.png" style="width: 580px;"><img src="https://us.v-cdn.net/6038925/uploads/images/75545i98906BC556EE670B/2025-05-07_10-58-54.png" role="button" title="2025-05-07_10-58-54.png" alt="2025-05-07_10-58-54.png" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P> <P>謝謝專家!</P>
Re: 分組圖形的X軸寬度可以單獨設定嗎?在貼文 N-2 中的圖片中,您似乎還可以點擊右側的「M」欄?
為了更好地理解這個問題,您能否添加一些評論來說明什麼是可能的,什麼是不可能的?
哪個 JMP 版本?
Re: 分組圖形的X軸寬度可以單獨設定嗎?經過再次思考(關於我原來的帖子):
我不建議創建這樣的圖表——非常危險。
我必須使用合併來壓縮 Y 軸上的標籤。 *)

否則,圖形產生器將繪製解壓縮後的影像:

一個)
合併導致 Y 軸上的標籤錯誤:1,2,3......而不是 12,13,14......
b)它是系統性的,但很危險:
要查看該問題,只需產生缺少一個條目的圖表(例如,沒有女性,15 歲):

由於「合併」將標籤替換為 1、2、3...這會導致女性長條圖發生偏移並與男性條形圖錯位(!)
這個主題很有趣,它說明了 JMP 如何處理缺少條目的資料。
順便說一下 - 在我的系統上,預設是

因此,如果您的圖表是空的:

轉到紅色三角形選單並啟動該選項。
下一行:
停用「包含缺失類別」後 -(以及我們新增的所有缺失值!)就沒有任何內容可繪製。
(圖形產生器也會從未使用缺少值的列的子圖中刪除該行)。
啟用「包含缺失類別」後,圖形產生器會將缺失值視為單獨的級別,從而添加不必要的分割。
為了消除分裂,我使用了合併選項,它“忽略”實際條目並用其排名替換各個值。如果相同的值在不同的子集中具有不同的等級,這是很危險的。
Re: 分組圖形的X軸寬度可以單獨設定嗎?有兩個選項:
@hogi寫道:
此外,無論是分割顏色或年齡軸:
最好忘記第二個 - 並使用第一個:

Graph Builder(
Transform Column( "N_M", Formula( If( :sex == "M", :N Rows ) ) ),
Transform Column( "N_F", Formula( If( :sex == "F", :N Rows ) ) ),
Variables( X( :height F ), X( :height M ), Y( :age ), Color( :N_F ), Color( :N_M ) ),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y, Color( 1 ), Legend( 1 ) ) ),
Elements( Position( 2, 1 ), Bar( X, Y, Color( 2 ), Legend( 2 ) ) ),
)
Re: 分組圖形的X軸寬度可以單獨設定嗎?dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d1=dt << Summary(
Group( :age, :sex ),
Sum( :height ),
statistics column name format( "column" )
);
New Column( "height M", Formula( If( :sex == "M", :height ) ));
New Column( "height F", Formula( If( :sex == "F", :height ) ));
p2=d1<< Graph Builder(
Transform Column( "age_F", Nominal, Formula( If( :sex == "F", :age ) ) ),
Transform Column( "age_M", Nominal, Formula( If( :sex == "M", :age ) ) ),
Size( 433, 323 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :height F ),
X( :height M ),
Y( :age_M, Combine( "Merged" ) ),
Y( :age_F, Position( 1 ), Combine( "Merged" ) ),
Color( :N Rows )
),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y( 2 )) ),
Elements( Position( 2, 1 ), Bar( X, Y( 1 ) ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 ), Inc( 100 ), Minor Ticks( 0 )} )
));
rpt = p2 << Report;
frames = rpt << XPath( "//FrameBox" );
For( i = 1, i <= N Items( frames ), i++,
frames[i] << Set Graphlet(
Picture(
try(Close(d2,nosave));
current data table(dt);
d2=dt<
<SUBSET></SUBSET>
Re: 分組圖形的X軸寬度可以單獨設定嗎?您喜歡透過年齡來採取這種方法嗎?
然後也許添加檢查以確保兩個子集包含完全相同的年齡組。
Re: 分組圖形的X軸寬度可以單獨設定嗎?這是AI賦予的。可以運行,但是我還是不知道如何取得我點擊的圖形的列號位置。
專家,您能給我一個代碼嗎?非常感謝!
Re: 分組圖形的X軸寬度可以單獨設定嗎?Caption(Char(dt<
<GET selected="" rows=""></GET>