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
- :
- Add custom marker at a certain point on a line graph

- 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

May 21, 2020 10:36 AM
(118 views)

Hi all,

I am plotting data curves for gait data using a line plot, as below.

What I am trying to do is add a custom marker at a certain value. For example, I want to highlight that an event occurs around the 25 mark without obscuring the rest of the graph. I know how to add a vertical reference line, but the graph becomes too busy as it overlays the lines. Is there a way just to add a custom marker as an overlay to this graph at a certain x-axis value? Thanks!

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

You can right click on the graph and select Customize, and in there you can add the code to place the marker where you want it.

Below are a couple of ways you can do it just through scripting

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Line( X, Y, Legend( 8 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
), Grid Line Order( 1 ), Reference Line Order( 3 ),
DispatchSeg(
TopSeg( 1 ),
{Set Script(
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
)}
)}
)
)
);
// or
gb = dt << Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Line( X, Y, Legend( 8 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
);
```

Jim

4 REPLIES 4

Highlighted

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

You can right click on the graph and select Customize, and in there you can add the code to place the marker where you want it.

Below are a couple of ways you can do it just through scripting

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Line( X, Y, Legend( 8 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
), Grid Line Order( 1 ), Reference Line Order( 3 ),
DispatchSeg(
TopSeg( 1 ),
{Set Script(
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
)}
)}
)
)
);
// or
gb = dt << Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Line( X, Y, Legend( 8 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Marker Size( 9 );
Pen Color( "Black" );
Marker( Marker State( 1 ), [113], [69] );
);
```

Jim

Highlighted
##

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

Re: Add custom marker at a certain point on a line graph

Works great. Thanks so much. I used the customize box to add the script and it worked without a hitch.

Highlighted
##

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

Re: Add custom marker at a certain point on a line graph

@txnelson answered the question about how to do what you want. I want to be sure that you know about a JMP Pro platform that is built to analyze curves and extract curve features for analysis in other JMP platforms. It is called the Functional Data Explorer. Curves are functional data.

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: Add custom marker at a certain point on a line graph

Thanks! I am analyzing the curve using a different program (which I also use to generate the data), I just find as of now, JMP is the easiest way for me to graph the data how I would like. I'm sure there's much easier solutions out there.