cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
reallyneedhelp
Level III

Adding a label to the graph's reference line based on a variable

Hi everyone, basically I have a portion of a whole list of codes which writes:

 

dt << Oneway(
	Y( y ),
	X( :column( x ) ),
	Plot Actual by Quantile( 1 ),
	Line of Fit( 0 ),
	Points Jittered( 1 ),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Add Ref Line( {pinkMin, SV}, "Solid", "Light Red", "", 1, 0.25 ),
			Add Ref Line( SV, "Solid", "Medium Light Red", "", 1 )}
		)
	)
)

This works perfectly fine when plotting graphs. However, when I tried to do something like this:

dt << Oneway(
	Y( y ),
	X( :column( x ) ),
	Plot Actual by Quantile( 1 ),
	Line of Fit( 0 ),
	Points Jittered( 1 ),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Add Ref Line( {pinkMin, SV}, "Solid", "Light Red", "", 1, 0.25 ),
			Add Ref Line( SV, "Solid", "Medium Light Red", SV, 1 )}
		)
	)
)

No label is out. SV and pinkMin are my variables. Is there any way in which I'm able to add a label to the reference line based on a variable? I have also tried Eval (SV), to which no result is out, and "SV", to which SV is my label instead of the value of SV.  Any comment will be appreciated. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
reallyneedhelp
Level III

Re: Adding a label to the graph's reference line based on a variable

Hi all. I have found the answer! Simply put Char(SV) in place of "...". Thank all of you!

View solution in original post

3 REPLIES 3
SDF1
Super User

Re: Adding a label to the graph's reference line based on a variable

Hi @reallyneedhelp,

 

  What exactly does SV refer to in your script? Is SV a list of text, e.g. {"text 1". "text 2",...}, or is it a column name, or is it a list of numbers? This might help to figure out what exactly is going wrong.

 

  Also, you might try replacing the SV with

 

Expr(SV[1]) where the [1] refers to the first element of whatever SV is, if it's a list of text or numbers.

 

  Then, around your entire script, you need to wrap it in an Eval(Eval Expr(your scirpt goes here)).

 

Hope this helps!

DS

reallyneedhelp
Level III

Re: Adding a label to the graph's reference line based on a variable

Hi @SDF1 ,

SV is refering to a value over here. It depends on the loop. For instance, during the first loop, SV will be equivalent to the value of 1.81, i.e. SV = 1.81. During the second loop, SV will be equivalent to the value of -9.11, i.e. SV = -9.11, and subsequently for respective loop. Is there any way to indicate inside the "..." that I am referring to the SV value and not just the words of SV inside "..."?

reallyneedhelp
Level III

Re: Adding a label to the graph's reference line based on a variable

Hi all. I have found the answer! Simply put Char(SV) in place of "...". Thank all of you!