cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Adding multiple horizonal reference lines based on columns

Hello, 

I'm having trouble adding a horizontal reference line in my plot based on a column parameter. The code is attached below. I need the reference line to be a horizontal line not a vertical line: 

Names Default to Here( 1 );
quantile_plot = Graph Builder(
	Size( 528, 631 ),
	Show Control Panel( 0 ),
	Variables( X( :Dataset ), Y( :y ), Color( :SAMPLEID ) ),
	Elements( Points( X, Y, Legend( 4 ), Jitter( "Random Uniform" ) ) ),
	Local Data Filter(
		Add Filter(
			columns( :Gender, :Ethnicity, :Age, :Congener ),
			Where( :Gender == "1" ),
			Where( :Ethnicity == "3" ),
			Where( :Age == "4" ),
			Where( :Congener == "LBC028" ),
			Display( :Ethnicity, N Items( 5 ) ),
			Display( :Age, N Items( 4 ) ),
			Display( :Congener, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	),
	SendToReport(
		Dispatch(
			{},
			"Dataset",
			ScaleBox,
			{Add Ref Line( -0.5, "Solid", "Red", "", 2 )}
		),
		Dispatch(
			{},
			"y",
			ScaleBox,
			{Scale( "Log" ), Format( "Best", 6 ), Min( 0.261333735635329 ),
			Max( 20 ), Inc( 1 ), Minor Ticks( 1 )}
		)
	)
);
report(quantile_plot)[axisbox(2)] << Add Ref Line( threshold, "solid", black, "", 2 );

report(quantile_plot)[axisbox(2)]<<  min(threshold);

 

MikeDereviankin_0-1649011473283.png

 

M. Dereviankin
2 REPLIES 2

Re: Adding multiple horizonal reference lines based on columns

Does the reference line appear if you translate or scale the Y axis to decrease the minimum value shown?  Since your script sets the min to the same value as the reference line, I would be concerned that numerical issues may cause the reference line to be clipped from view.

Re: Adding multiple horizonal reference lines based on columns

The line needs to be horizontal based on the value that is listed for, 'threshold'. I want these so I can automatically create a data filter and see how this line changes. 

M. Dereviankin

Recommended Articles