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
- :
- Box Plot Properties

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

Apr 2, 2012 1:56 AM
(4174 views)

In the following little script I've created a box plot using the Graph Builder, and then listed all the properties of the object I've just created:

dt = open**(**"$SAMPLE_DATA/Big Class.jmp"**)**;

dtg = Graph Builder**(**

Show Control Panel**(** **0** **)**,

Variables**(** X**(** dt:sex **)**, Y**(** dt:height **)** **)**,

Elements**(** Box Plot**(** X, Y, Outliers**(** **1** **)**, Box Style**(** "Outlier" **)** **)** **)**

**)**;

show properties**(**dtg**)**;

Now - suppose later in the script I wanted to *change* the box style from "Outlier" to one of the other three available options ("Quantile", "Solid" or "Thin"). I see that among the properties of dtg there's one called "Elements", which is presumably the one I need to access - but I don't know how to change one of its settings. My first guess would be something like "dtg << elements(Box Style(Box Plot("Solid"))), but that doesn't work. Can something like that be done, and if so, how?

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions

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

There may be a simpler way to express it but the following seems to work. I made the changes to each box plot using "Customize" in Graph Builder, looked at the script, and moved the SendToReport stuff from within GB to outside it. If there is an undetermined number of categories then you'd have to handle that somehow as well. When I changed both bars simultaneously in GB the resulting script simply replaced "Outlier" with "Solid" instead of showing code to make the change.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtg = Graph Builder(

Show Control Panel( 0 ),

Variables( X( dt:sex ), Y( dt:height ) ),

Elements( Box Plot( X, Y, Outliers( 1 ), Box Style( "Outlier" ) ) )

);

dtg << SendToReport(

Dispatch(

{},

"Graph Builder",

FrameBox,

{DispatchSeg( BoxPlotSeg( 1 ), Box Style( "Solid" ) ),

DispatchSeg( BoxPlotSeg( 2 ), Box Style( "Solid" ) )}

)

);

2 REPLIES 2

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

There may be a simpler way to express it but the following seems to work. I made the changes to each box plot using "Customize" in Graph Builder, looked at the script, and moved the SendToReport stuff from within GB to outside it. If there is an undetermined number of categories then you'd have to handle that somehow as well. When I changed both bars simultaneously in GB the resulting script simply replaced "Outlier" with "Solid" instead of showing code to make the change.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtg = Graph Builder(

Show Control Panel( 0 ),

Variables( X( dt:sex ), Y( dt:height ) ),

Elements( Box Plot( X, Y, Outliers( 1 ), Box Style( "Outlier" ) ) )

);

dtg << SendToReport(

Dispatch(

{},

"Graph Builder",

FrameBox,

{DispatchSeg( BoxPlotSeg( 1 ), Box Style( "Solid" ) ),

DispatchSeg( BoxPlotSeg( 2 ), Box Style( "Solid" ) )}

)

);

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

Re: Box Plot Properties

That's just what I needed - many thanks! And thanks also for the explanation of how to work it out: that's also very useful for future reference.