cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
syretted
Level II

Add custom marker at a certain point on a line graph

Hi all,

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

Example.png 

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
txnelson
Super User

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

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. 

marker.PNG

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

View solution in original post

4 REPLIES 4
txnelson
Super User

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

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. 

marker.PNG

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
syretted
Level II

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.

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.

syretted
Level II

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.