我被要求制作如下图所示的图表,将一年与另一年进行比较。但我不知道如何在 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
- 基本图形(特别是图形生成器部分)