Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Re: JMP CDF Plots

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 20, 2013 10:18 PM
(5892 views)

When I used JMP to plot CDF plot, I can right-click, and then customize the line style (solid, dashed, etc.), change line thickness, change line color, etc. But those changes seems not included in the 'Script'. When I copy and paste the script, it just the standard CDF plot. How could I change the CDF lines' color/style/thickness using JMP script?

Thanks,

Qian

Solved Go to Solution

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I can't find a way to address individual lines in the CDF plot by JSL. An alternative is to create the plot from scratch which would give you much more control of the appearance.

Here's an example based on the *Big Class.jmp* sample data:

Names Default To Here**(** **1** **)**;

dt1 = Open**(** "$SAMPLE_DATA/Big Class.jmp" **)** << Split**(**

Split By**(** :age **)**,

Split**(** :height **)**,

Remaining Columns**(** Drop All **)**

**)**;

Y = dt1 << get as matrix;

colors = **{**"red", "blue", "green", "yellow", "black", "red"**}**;

sizes = **{****1**, **2**, **1**, **2**, **3**, **5****}**;

styles = **{**"Solid", "Solid", "Dotted", "Dashed", "DashDot", "DashDotDot"**}**;

// Draw empirical CDF

New Window**(** "Empirical CDF",

Graph Box**(**

X Scale**(** min**(**Y**)**-**1**, max**(**Y**)**+**1** **)**,

Y Scale**(** -**0.0**, **1.1** **)**,

For**(** j = **1**, j <= N Col**(** Y **)**, j++,

**{**Quant, CumProb**}** = CDF**(** Y**[****0**, j**]** **)**; // CDF function

Pen Color**(** Eval**(** colors**[**j**]** **)** **)**;

Pen Size**(** Eval**(** sizes**[**j**]** **)** **)**;

Line Style**(** styles**[**j**]** **)**;

For**(** i = **2**, i <= N Row**(** Quant **)**, i++,

H Line**(** Quant**[**i - **1****]**, Quant**[**i**]**, CumProb**[**i**]** **)**;

V Line**(** Quant**[**i - **1****]**, CumProb**[**i - **1****]**, CumProb**[**i**]** **)**;

**)**

**)**

**)**

**)**;

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP CDF Plots

Hello:

Easier than you think:

e.g. insert:

Pen Color( "red" );

Pen Size( 3 );

Y Function(

F Distribution( q, dfn, dfd );

...

see also:

/Help, Scripting Index, Display, Graph Box command for a Pen Color example.

best regards,

-Matt

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP CDF Plots

Thanks.

I give it a try and get similar plots.

I have data column 'Res' (Y) and another category column 'Test_ID' (X). 'Test_ID' can be 'A', 'B', 'C', 'D', 'E'. By default JMP assign them different colors.

What I want to do is to make CDF plot Line 'C', thicker, Line 'E', a dashed line. I can right-click on each plot to customize them, while since I have many plots, and want to make similar changes, so I am wondering whether I can do it in script.

Here is my script:

=======================================

Pen Color( "red" );

Pen Size( 5 );

Oneway(

Y( :Res ),

X( :Test_ID),

CDF Plot( 1 ),

SendToReport(

Dispatch(

{},

"1",

ScaleBox,

{Min( 10), Max( 14 ), Inc( 0.5 ), Minor Ticks( 1 ),

Show Major Grid( 1 ), Show Minor Grid( 1 ),

Rotated Labels( "Horizontal" )}

),

Dispatch(

{"CDF Plot"},

"1",

ScaleBox,

{Min( 10 ), Max( 14 ), Inc( 0.5 ), Minor Ticks( 1 ),

Show Major Grid( 1 ), Show Minor Grid( 1 ),

Rotated Labels( "Horizontal" )}

),

Dispatch( {"CDF Plot"}, "Oneway CDF", FrameBox, {Line Width Scale( 3 )} )

)

);

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I can't find a way to address individual lines in the CDF plot by JSL. An alternative is to create the plot from scratch which would give you much more control of the appearance.

Here's an example based on the *Big Class.jmp* sample data:

Names Default To Here**(** **1** **)**;

dt1 = Open**(** "$SAMPLE_DATA/Big Class.jmp" **)** << Split**(**

Split By**(** :age **)**,

Split**(** :height **)**,

Remaining Columns**(** Drop All **)**

**)**;

Y = dt1 << get as matrix;

colors = **{**"red", "blue", "green", "yellow", "black", "red"**}**;

sizes = **{****1**, **2**, **1**, **2**, **3**, **5****}**;

styles = **{**"Solid", "Solid", "Dotted", "Dashed", "DashDot", "DashDotDot"**}**;

// Draw empirical CDF

New Window**(** "Empirical CDF",

Graph Box**(**

X Scale**(** min**(**Y**)**-**1**, max**(**Y**)**+**1** **)**,

Y Scale**(** -**0.0**, **1.1** **)**,

For**(** j = **1**, j <= N Col**(** Y **)**, j++,

**{**Quant, CumProb**}** = CDF**(** Y**[****0**, j**]** **)**; // CDF function

Pen Color**(** Eval**(** colors**[**j**]** **)** **)**;

Pen Size**(** Eval**(** sizes**[**j**]** **)** **)**;

Line Style**(** styles**[**j**]** **)**;

For**(** i = **2**, i <= N Row**(** Quant **)**, i++,

H Line**(** Quant**[**i - **1****]**, Quant**[**i**]**, CumProb**[**i**]** **)**;

V Line**(** Quant**[**i - **1****]**, CumProb**[**i - **1****]**, CumProb**[**i**]** **)**;

**)**

**)**

**)**

**)**;

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP CDF Plots

Thanks!

It looks like starting from scratch will make everything more flexible.

And it seems on CDF plots, when we right-click and choose 'Customizing', the changes will only apply to one plot, even we push down the 'Ctrl' button. For more general features, like 'Line Thickness', with 'Ctrl' pushed, the line thickness of all plots within that window will be changed. So 'Customizing' is a localized function?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP CDF Plots

Hi,

For Graph Box, do we really need to specify the colors per line?

I was wondering if instead of using this line

`colors = {"red", "blue", "green", "yellow", "black", "red"};`

can we tell JMP to follow the color scheme in the JMP preferences?

Thanks,

Shaira