使用 JMP 16 我創建了以下圖表

資料表每個年齡層有 3 個數據點

我打開了 Graph Builder,將資料列拖到 Y 拖放區域,將年齡列拖到 X 拖放區域,並將年齡列拖到覆蓋拖放區域

然後我添加了一行並選中了“行順序”複選框

(調整了點的抖動限制

然後,只需更改每個圖例設定的標記和標記顏色即可

Names default to here(1);
New Table(
"Example",
Add Rows( 18 ),
New Column( "Age", Ordinal,
Set Values(
[12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17]
)
),
New Column( "Data",
Format( "Fixed Dec", 12, 1 ),
Set Values(
[51, 58.125, 66, 56, 60.2857142857143, 65, 61, 64.1666666666667, 69, 62,
64.5714285714286, 67, 60, 64.3333333333333, 68, 62, 66.6666666666667, 70
]
)
)
);
Graph Builder(
Size( 525, 448 ),
Show Control Panel( 0 ),
Error Bar Offset( 0 ),
Graph Spacing( 0 ),
Variables( X( :age ), Y( :Data ), Overlay( :age ) ),
Elements(
Line( X, Y, Legend( 7 ), Row order( 1 ), Missing Values( "No Connection" ) ),
Points( X, Y, Legend( 11 ), Jitter Limit( 0 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Properties( 0, {Line Color( 0 )}, Item ID( "12", 1 ) ),
Properties( 1, {Line Color( 0 )}, Item ID( "13", 1 ) ),
Properties( 2, {Line Color( 0 )}, Item ID( "14", 1 ) ),
Properties( 3, {Line Color( 0 )}, Item ID( "15", 1 ) ),
Properties( 4, {Line Color( 0 )}, Item ID( "16", 1 ) ),
Properties( 5, {Line Color( 0 )}, Item ID( "17", 1 ) )
), Legend Model(
11,
Base( 0, 0, 0, Item ID( "12", 1 ) ),
Base( 1, 0, 0, Item ID( "13", 1 ) ),
Base( 2, 0, 0, Item ID( "14", 1 ) ),
Base( 3, 0, 0, Item ID( "15", 1 ) ),
Base( 4, 0, 0, Item ID( "16", 1 ) ),
Base( 5, 0, 0, Item ID( "17", 1 ) ),
Properties(
0,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "12", 1 )
),
Properties(
1,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "13", 1 )
),
Properties(
2,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "14", 1 )
),
Properties(
3,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "15", 1 )
),
Properties(
4,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "16", 1 )
),
Properties(
5,
{Line Color( 0 ), Marker( "Minus" )},
Item ID( "17", 1 )
)
)}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 6 ), Marker Drawing Mode( "Normal" )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {7, [6, 7, 8, 9, 10, 11], 11, [0, 1, 2, 3, 4, 5]} )}
)
)
);
如果有三個不同的列,這種方法將有效。
New Table( "Untitled 9",
Add Rows( 5 ),
New Script(
"Low & 2 more vs. x",
Graph Builder(
Size( 518, 454 ),
Show Control Panel( 0 ),
Variables(
X( :x ),
Y( :Low ),
Y( :Mid, Position( 1 ) ),
Y( :Upper, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Y( 3 ), Legend( 7 ), Bar Style( "Interval" ) ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ) ),
Line( X, Y( 2 ), Legend( 9 ) )
)
)
),
New Column( "Low", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 1.4, 3.6, 2.1, 2.3] )
),
New Column( "Mid", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [3, 3.7, 5, 3, 4] )
),
New Column( "Upper", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [5.1, 6.4, 7, 5.2, 6.7] )
),
New Column( "x", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5] )
)
);
運行此腳本後,點擊綠色三角形即可產生圖形。
