如何更改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种颜色值。 你能提供一个你正在思考的模型吗?