我被要求製作如下圖所示的圖表,將一年與另一年進行比較。但我不知道如何在 JMP 中執行此操作(或其他任何誠實的方法)。誰能幫我指出正確的方向?

這是實現此目的的一種方法。給定一個數據表

我使用圖形生成器生成了下面的圖表,並添加了圖形

下面是產生上圖的 JSL
Names Default To Here( 1 );
dt = Data Table( "Example" );
gb = dt << Graph Builder(
Size( 648, 450 ),
Show Control Panel( 0 ),
Variables( X( :Month ), Y( :Value ) ),
Elements( Points( X, Y, Legend( 3 ), Error Interval( "Range" ) ) ),
SendToReport(
Dispatch(
{},
"Value",
ScaleBox,
{Min( -8.0923781757601 ), Max( 122.008163265306 ), Inc( 20 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Properties( 0, {Line Color( 16 )}, Item ID( "Value", 1 ) ),
Properties( -1, {Line Color( 16 )}, Item ID( "Jan", 1 ) ),
Properties( -1, {Line Color( 16 )}, Item ID( "Mean", 1 ) )
)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Previous 5-year average 2023" )}
),
Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "400", LegendBox, {Legend Position( {3, [-1, -3]} )} )
)
);
// Add the Circles and Lines
Report( gb )[FrameBox( 1 )] <<
Add Graphics Script(
For Each Row(
If( :Type == "High",
Fill Color( "Gray" );
theHigh = :Value;
theLow = :Value[Row() + 1];
Pen Color( "Gray" );
Pen Size( 4 );
X = Matrix( Floor( Row() / 2 ) ) || Matrix( Floor( Row() / 2 ) );
y = Matrix( theHigh ) || Matrix( theLow );
Line( X, Y );
theList = {};
Insert Into( theList, X[1] );
Insert Into( theList, Y[1] );
Circle( theList, 7, "Fill" );
,
Fill Color( "Red" );
theList = {};
Show( Floor( Row() - 1 ) );
Insert Into( theList, Floor( (Row() - 1) / 2 ) );
Insert Into( theList, :value );
Circle( theList, 7, "Fill" );
// Add the numerical value in the circle
Text Color( "White" );
// Subtract a fudge factor to better center the text
theList[2] = :Value - 3;
Text Font( "Segoe UI", 14, "Bold" );
Text( Center Justified, theList, Char( :Value ) );
)
)
);這是我正在使用的數據文件。我真的很想對 2022 年和 2023 年的情況進行逐月比較(每種病毒一個)。
使用@scott_allen方法(比我的好得多)和您的數據,我使用圖形生成器以交互方式創建了這些圖形。

我對你的數據唯一要做的就是
- 將資料子集化,僅保留 2022 年和 2023 年的資料。
- 使用 Tables=>Split 拆分子集資料表,
- 劃分依據:年份
- 拆分欄位:比率
- 選擇“全部保留”
使用新的分割資料表

- 開啟圖形產生器
- 為了為每個病毒製作單獨的圖表,我選擇了“病毒”並將其拖曳到“頁面”下拉列表中。
- 選擇“月份”列並將其拖曳到 X 軸放置區域
- 選擇 2022 和 2023 列並將它們拖曳到 Y 軸放置區域
- 若要關聯 2 年列,請選取 2022 和 2023 並將它們拖曳到間隔放置區域
- 在圖例中,右鍵單擊藍點並選擇“標記大小”
- 選擇“其他”
- 類型40
- 對紅點重複步驟 6
- 您可以右鍵單擊這些點並根據您的喜好更改顏色
最重要的是閱讀“幫助”下拉選單下提供的文件。
- 發現 JMP
- 使用 JMP
- 基本圖形(特別是圖形產生器部分)