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
- :
- How to insert data labels in graph builder

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

Highlighted

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

Created:
Nov 3, 2016 12:21 PM
| Last Modified: Aug 18, 2017 2:37 PM
(20543 views)

Can someone please tell me how to insert data labels in Confidence interval plots and control chart averages of Jmp12? See the attached image for better clarification.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

Here is the simple script to give you a start. It can be made far more fancy, but this should give you a start:

```
Names Default To Here( 1 );
dt = Current Data Table();
// Calculate the means so they can be displayed
Summarize( dt, bygroup = by( :Name( "Factor-1" ) ), themeans = Mean( :thickness ) );
// Run the basic graph builder code
gb = dt << Graph Builder(
Variables( X( :Name( "Factor-1" ) ), Y( :Thickness ) ),
Elements( Points( X, Y, Legend( 5 ), Summary Statistic( "Mean" ), Error Bars( "Confidence Interval" ) ) )
);
// Loop across the different factors and add the mean as a text
// Note, that because the x axis values are based upon a character column,
// the X position is 0 for the first group, 1 for the second, etc.
For( i = 1, i <= N Items( bygroup ), i++,
Eval(
Substitute(
Expr(
Report( gb )[framebox( 1 )] << add graphics script( Text( {__x__, __y__}, __mean__ ) )
),
Expr( __x__ ), i-1 + .1,
Expr( __y__ ), themeans[i],
Expr( __mean__ ), Char( Themeans[i] )
)
)
);
```

Jim

8 REPLIES 8

Highlighted
##

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

Re: How to insert data labels in graph builder

Are you asking how to interactively add labels to the chart?

Since the Mean and Confidence Intervals are calculated values, you can not use the Row State Label options to display the values. You can right click on the graph, and add a caption box, however, the stats displayed there are overall stats. What you will need to do is to go to the Drawing tools and select a text entry box, and to add it manually to the graph.

Jim

Highlighted
##

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

Re: How to insert data labels in graph builder

Thanks Jim.

It looks like that I have to manually calculate stat for each factor and insert in a caption box!

Highlighted
##

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

Re: How to insert data labels in graph builder

Created:
Nov 7, 2016 11:32 AM
| Last Modified: Nov 7, 2016 11:34 AM
(20487 views)
| Posted in reply to message from BemRan 11-07-2016

A script can be written to handle that issue. The summary stats can be calculated and then annotation can be added to the graph that contains the summary information

If you have some sample data I can give you a good start on how to do that.

Jim

Highlighted
##

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

Re: How to insert data labels in graph builder

Thanks! I have attached a simple two factor data table.

Highlighted
##

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

Re: How to insert data labels in graph builder

Highlighted
##

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

Re: How to insert data labels in graph builder

Created:
Nov 7, 2016 2:17 PM
| Last Modified: Aug 18, 2017 2:38 PM
(20472 views)
| Posted in reply to message from BemRan 11-07-2016

My fault.....there is an issue with the current discussion forum, where you can not attach something after the initial responses. Can you convert it to a script:

Under the "Source" entry in the Tables Panel for the data table, click on it and select

"Copy Table Script"

Then click on the "Insert JSL Code" in your reply and paste the code into it

Jim

Highlighted
##

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

Re: How to insert data labels in graph builder

Highlighted

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

Here is the simple script to give you a start. It can be made far more fancy, but this should give you a start:

```
Names Default To Here( 1 );
dt = Current Data Table();
// Calculate the means so they can be displayed
Summarize( dt, bygroup = by( :Name( "Factor-1" ) ), themeans = Mean( :thickness ) );
// Run the basic graph builder code
gb = dt << Graph Builder(
Variables( X( :Name( "Factor-1" ) ), Y( :Thickness ) ),
Elements( Points( X, Y, Legend( 5 ), Summary Statistic( "Mean" ), Error Bars( "Confidence Interval" ) ) )
);
// Loop across the different factors and add the mean as a text
// Note, that because the x axis values are based upon a character column,
// the X position is 0 for the first group, 1 for the second, etc.
For( i = 1, i <= N Items( bygroup ), i++,
Eval(
Substitute(
Expr(
Report( gb )[framebox( 1 )] << add graphics script( Text( {__x__, __y__}, __mean__ ) )
),
Expr( __x__ ), i-1 + .1,
Expr( __y__ ), themeans[i],
Expr( __mean__ ), Char( Themeans[i] )
)
)
);
```

Jim

Article Labels

There are no labels assigned to this post.