cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Thierry_S
Super User

GraphBuilder > FrameBox << Add Graphics Script (V Line (x,y1,y2)): dynamically assign x, y1, and y2?

Hi JMP Community,

It's my turn to be stumped by an apparently trivial project.

I'm trying to dynamically add V Lines to a Graph Builder plot and I'm getting rather unexpected results with the test script below:

Names Default to Here (1);

dt = New Table ("TEST", 
	New Column ("X", Set Values ([1,2,3,4,5])),
	New Column ("Y", Set Values ([3,2,5,8,6]))
		
);

gb = dt << Graph Builder(
			Fit to Window( "Off" ),
			Level Frame Color( "Medium Dark Gray" ),
			Level Spacing Color( "Medium Dark Gray" ),
			Level Underline( 1 ),
			Page Level Underline( 0 ),
			Spacing Borders( 1 ),
			Variables( X( :X ), Y( :Y ) ),
			Elements( Points( X, Y, Legend( 5 ) ) )
			);

gbr = gb << report;


Ypos1 = 2;
Ypos2 = 6;

For (i = 1, i<=5, i++,
		
				Xpos = i;
				
				gbr [Framebox (1)] << Add graphics Script (
	
					Pen color (Green);
					V Line (1,4,6);	
					Pen color (Red);
					V Line (Xpos, Ypos1, Ypos2);
					Pen color (blue);
					V Line (i, 6,8);
	
				)
);	

I get the green V Line correctly placed, I get one red V Line positioned at X = 5, and no blue line.

I tried adding Eval Expr (Expr()) for the entire expression and within the graphic script without success, so I'm sure that there is a simple solution that is escaping me at this late hour.

Any help would be greatly appreciated.

Thanks,

TS

Thierry R. Sornasse
2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: GraphBuilder > FrameBox << Add Graphics Script (V Line (x,y1,y2)): dynamically assign x, y1, and y2?

I seem to be able to get blue lines with eval(evalexpr(:

Eval(EvalExpr(gbr [Framebox (1)] << Add graphics Script (

	Pen color (Green);
	V Line (1,4,6);	
	Pen color (Red);
	V Line (Xpos, Ypos1, Ypos2);
	Pen color (Blue);
	V Line (Expr(i), 6,8);

)))

jthi_0-1615453483308.png

 

Using JMP15.2.1

-Jarmo

View solution in original post

pauldeen
Level VI

Re: GraphBuilder > FrameBox << Add Graphics Script (V Line (x,y1,y2)): dynamically assign x, y1, and y2?

For (i = 1, i<=5, i++,
		
				Xpos = i;
				
				Eval(EvalExpr(gbr [Framebox (1)] << Add graphics Script (
	
					Pen color (Green);
					V Line (1,4,6);	
					Pen color (Red);
					V Line (expr(Xpos), expr(Ypos1), expr(Ypos2));
					Pen color (blue);
					V Line (expr(i), 6,8);
	
				)))
);	

pauldeen_0-1615457793746.png

 

 

View solution in original post

2 REPLIES 2
jthi
Super User

Re: GraphBuilder > FrameBox << Add Graphics Script (V Line (x,y1,y2)): dynamically assign x, y1, and y2?

I seem to be able to get blue lines with eval(evalexpr(:

Eval(EvalExpr(gbr [Framebox (1)] << Add graphics Script (

	Pen color (Green);
	V Line (1,4,6);	
	Pen color (Red);
	V Line (Xpos, Ypos1, Ypos2);
	Pen color (Blue);
	V Line (Expr(i), 6,8);

)))

jthi_0-1615453483308.png

 

Using JMP15.2.1

-Jarmo
pauldeen
Level VI

Re: GraphBuilder > FrameBox << Add Graphics Script (V Line (x,y1,y2)): dynamically assign x, y1, and y2?

For (i = 1, i<=5, i++,
		
				Xpos = i;
				
				Eval(EvalExpr(gbr [Framebox (1)] << Add graphics Script (
	
					Pen color (Green);
					V Line (1,4,6);	
					Pen color (Red);
					V Line (expr(Xpos), expr(Ypos1), expr(Ypos2));
					Pen color (blue);
					V Line (expr(i), 6,8);
	
				)))
);	

pauldeen_0-1615457793746.png