如何更改CDF或分位數圖中的線條顏色?嗨,
我正在生成像下面的例子那樣的累積圖。
但是,我想要的顏色不是由col2確定,而是由col3確定。
添加顏色(:col3)沒有做到這一點......
謝謝,菲爾
單程(
Y(:col1),X(:col2),
所有圖形(0),按實際(1)繪製分位數,擬合線(0),X軸比例(0),大平均值(0),顏色(:col3)
)
Re:如何在CDF或分位數圖中改變線條顏色?再次感謝您的努力。
我相信你的腳本建議中有一些語法錯誤,我
固定。見下文。但是,我不斷收到“無法找到”等錯誤消息
ScaleBox [“400”]在{}“,即使我按照你的建議選擇”222“。(順便說一句,
永遠不明白這個數字是什麼意思)並且線條樣式不是
調整。顏色和以前一樣好用。
謝謝,菲利普
Expr =
“單程(
Y(:重量),
X(:Sex_Class),
所有圖表(0),
按實際繪製分位數(1),
適合線(0),
X軸比例(0),
中庸之道(0),
SendToReport(
調度({} \!“400 \!”,
ScaleBox,
{傳奇模型(1“;
對於(i = 1,i <= N項(組),i ++,
Expr = Expr || “,屬性(”|| Char(i)||“,{Line Style(\!”“||
linetype [Mod(i,5)+ 1] || “\!” )})“;
);
Expr = Expr || “)})))”;
Eval(Parse(Expr));
Re:如何在CDF或分位數圖中改變線條顏色?嘗試這個尺寸
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Create a new column
dt << New Column( "Sex_Class", character, formula( :Sex || "_" || Char( :Age ) ) );
// Determine how many groups in the :Sex_Class
Summarize( dt, groups = by( :Sex_Class ) );
// Create the value colors list
colorlist = {};
For( i = 1, i <= N Items( groups ), i++,
If( Substr( groups[i], 1, 1 ) == "F",
color = 19,
color = 21
);
Eval(
Substitute(
Expr(
Insert Into( colorlist, __group__ )
),
Expr( __group__ ), Parse( "{\!"" || groups[i] || "\!"" || "=" || Char( color ) || "}" )
)
);
);
// Set the Value Colors property for the Sex_Class column
dt:sex_CLASS << set property( "value colors", Eval( colorlist ) );
linetype = {"Solid", "Dotted", "DashDot", "DashDotDot", "Dashed"};
TheExpr =
"Oneway(
Y( :weight ),
X( :Sex_Class ),
All Graphs( 0 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0 ),
X Axis Proportional( 0 ),
Grand Mean( 0 ),
SendToReport(
Dispatch(
{},
\!"222\!",
ScaleBox,
{Legend Model(
1,";
For( i = 1, i <= N Items( groups ), i++,
If( i > 1,
TheExpr = TheExpr || ","
);
TheExpr = TheExpr || "Properties(" || Char( i ) || ", {Line Style(\!"" || linetype[Mod( i, 5 ) + 1] || "\!" )} )";
);
TheExpr = TheExpr || "),
)}
)";
Eval( Parse( theexpr ) );
只有5種線型可供選擇
Re:如何在CDF或分位數圖中改變線條顏色?哇!我印象深刻!有用!我修改了腳本以適應
超過2種顏色的情況:
//確定批次的顏色
總結(DT,基團=由(:sex_class));
colorlist = {};顏色= 3; Sxcnt =字(1,組[1],“_”);
對於(j = 1,j <= n項(組),j ++,
如果(不(字(1,基團[j]時,“_”)== Sxcnt),顏色=顏色+ 1; Sxcnt =字(1,基團[j]時,“_”));
Eval(替代(Expr(插入(colorlist,__ group__)),expr(__ group__
),解析(“{\!”“|| groups [j] ||”\!“”||“=”|| char(color)||“}”)));
);
DT:sex_class <
非常感謝,但現在我變得貪心了。如何按班級改變破折號風格?
謝謝,菲利普
Re:如何在CDF或分位數圖中改變線條顏色?您可以通過為您正在使用的:Sex_Class列設置所需的值顏色來實現您想要的效果。 這是JSL做的,但它可以很容易地以交互方式完成
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Create a new column
dt << new column("Sex_Class", character,
formula(:Sex || "_" || char(:Age))
);
// Determine how many groups in the :Sex_Class
summarize(dt,groups=by(:Sex_Class));
// Create the value colors list
colorlist={};
For(i=1,i<=n items(groups),i++,
If(substr(groups[i],1,1)=="F",
color=19,
color=21
);
Eval(
Substitute(
Expr(
insert into(colorlist, __group__ )),
expr( __group__ ), parse("{\!""||groups[i]||"\!""||"="||char(color)||"}")
)
)
);
// Set the Value Colors property for the Sex_Class column
dt:sex_CLASS<<SET property=""></SET>

Re:如何在CDF或分位數圖中改變線條顏色?對於迅速的反應很有幫助。
附件是幾個M / F類的例子。每個班級都有自己的路線
但是由性別定義的顏色。
在蛋糕上結冰將按性別顏色和破折號類別:)
菲利普
單程(
Y(:重量),
X(:Sex_Class),
所有圖形(0),按實際(1)繪製分位數,擬合線(0),X軸
比例(0),大均值(0),顏色(:性別),
SendToReport(
Dispatch({“Normal Quantile Plot”},“Oneway QuantilePlot”,FrameBox,{Line
寬度比例(3),透明度(0)}),
)
)
Re:如何在CDF或分位數圖中改變線條顏色?我可以理解你如何通過不同的列為數據點著色
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << Oneway(
Y( :weight ),
X( :sex ),
All Graphs( 0 ),
Plot Quantile by Actual( 1 ),
Line of Fit( 0(1) ),
X Axis Proportional( 0 ),
Grand Mean( 0 )
);
dt << color by( :age );
但我不知道你是如何直接用線段做的,因為每個段都鏈接在2個值之間,這些值可能有2個不同的第3種顏色值。 你能提供一個你正在思考的模型嗎?