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

- JMP User Community
- :
- Discussions
- :
- How to add multiple reference lines to Y-axis 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:
Feb 28, 2019 10:43 AM
| Last Modified: Feb 28, 2019 1:12 PM
(10395 views)

Hi All,

I came across some problems while using graph builder , I need to add different refrence lines to the Y-axis (like the attahced plot), which is catogorized into 4 groups.

but the defaut setting is that all groups apply to the same reference lines, could any one help to sovle this?

thanks in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

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

Created:
Feb 28, 2019 1:36 PM
| Last Modified: Feb 28, 2019 2:19 PM
(10354 views)
| Posted in reply to message from EricTsai 02-28-2019

Hi, I found this script previously in the community and save it becuse I need to create charts with different reference lines per group, hope this is also what you need.

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Different values for each group takes more work
gb2 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gb2Rep = Report(gb2);
// Females . . .
gb2Rep[Framebox(1)] << addGraphicsScript(
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
gb2Rep[Framebox(2)] << addGraphicsScript(
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);
```

Highlighted

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

This suggestion involves scripting but it is minimal.

- Right-click in one of the plots and select
**Customize**. - Click
**Add**(plus sign). - Type
**H Line( Y )**, where the**Y**argument is the value for the reference line. - Click
**OK**.

Repeat this process for each plot that requires a unique reference line.

Note that if you save a script now, it should include the customizations that you made.

Note that you can precede the graphic function with others to first determine attributes like color and line style.

Learn it once, use it forever!

- Tags:
- work very well

12 REPLIES 12

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

Did you try it interactively and save the script?

Learn it once, use it forever!

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

Sorry, i dont know how to use JSL to add reference lines..

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

I did not say to use a script. I said interactively. Try right-clicking on one of these axes and select Axis Settings. Add the reference lines you want and click OK. If it only adds it to one of them, the right-click and select Edit > Copy Axis Settings. Hold the Control key, right-click on another axis, and select Edit > Paste Axis Settings.

Does either way work?

Learn it once, use it forever!

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

Yeah it works, But what i need is to add different ref. lines for each group,respectively. thanks !!

Highlighted

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

Created:
Feb 28, 2019 1:36 PM
| Last Modified: Feb 28, 2019 2:19 PM
(10355 views)
| Posted in reply to message from EricTsai 02-28-2019

Hi, I found this script previously in the community and save it becuse I need to create charts with different reference lines per group, hope this is also what you need.

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Different values for each group takes more work
gb2 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gb2Rep = Report(gb2);
// Females . . .
gb2Rep[Framebox(1)] << addGraphicsScript(
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
gb2Rep[Framebox(2)] << addGraphicsScript(
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);
```

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

thanks a lot , it helps~

Highlighted

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

This suggestion involves scripting but it is minimal.

- Right-click in one of the plots and select
**Customize**. - Click
**Add**(plus sign). - Type
**H Line( Y )**, where the**Y**argument is the value for the reference line. - Click
**OK**.

Repeat this process for each plot that requires a unique reference line.

Note that if you save a script now, it should include the customizations that you made.

Note that you can precede the graphic function with others to first determine attributes like color and line style.

Learn it once, use it forever!

- Tags:
- work very well

Highlighted
##

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

GOT IT~ THANKS A LOT

Highlighted
##

This script is what I am looking for, but it assumes that the data in Framebox(1) is for the Female group. How could I test this to make sure that I was the lines to the correct Framebox?

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

Re: How to add multiple reference lines to each group on left Y-axis in graph builder?

Article Labels

There are no labels assigned to this post.