schrodingerscat
schrodingerscat

Reputation: 199

In JMP, how to custom graph line by specifying the curve name?

In JMP, we can custom any fit curve using this code

obj << (Curve[1] << Line Style( DashDot ));

Now what I want to customize the line style not based from curve number but by curve name.

Example, if I have 5 curves (grouped by day of the week), I want all days that start with "S" (i.e. weekends) to be DashDot.

Is there a way to do this?

Thank you.

Upvotes: 1

Views: 702

Answers (1)

schrodingerscat
schrodingerscat

Reputation: 199

I found a solution. It consists of two steps: 1. Store the grouping column contents in a list. Get the size of the list 2. Add a for loop in the plotting script which customs the line style if a certain criteria is fulfilled.

Here's the code for step1:

Summarize(A = by(groupcol));
B=groupcol<<get property(value ordering);
If (Isempty(B),
GroupList=A;,
GroupList=B;
);
GroupListN=Nitems(GroupList);

Here's the code for step2:

For( c=1, c<=GroupListN, c++,
    If (Left(GroupList[c],1)=="S",
    plotscript=plotscript||"biv << (Curve[" ||Char(c)||"] << Line Style( Dashed ));";
        );
    );
plotscript  = plotscript|| "rbiv = biv<<report;"
plotscript = Eval( Parse( plotscript ) );

The plotscript variable contains the plotting script. The second code block is added.

Upvotes: 1

Related Questions