cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Can the vertical dividing line of the X-axis in the drawing only show part of it?

Thanks Experts!

dt=Open("$SAMPLE_DATA/Big Class.jmp");
p1=dt<< Graph Builder(
	Size( 534, 455 ),
	Show Control Panel( 0 ),
	Variables(
		X( Transform Column( "Row", Formula( Row() ) ) ),
		Y( :height ),
		Y( :weight )
	),
	Elements( Position( 1, 1 ), Line( X, Y, Legend( 5 ) ) ),
	Elements( Position( 1, 2 ), Bar( X, Y, Legend( 7 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Row",
			ScaleBox,
			{Add Ref Line( 10.5, "Dotted", "Dark Red", "", 1 ),
			Add Ref Line( 20.5, "Dotted", "Dark Red", "", 1 ),
			Add Ref Line( 30.5, "Dotted", "Dark Red", "", 1 )}
		)
	)
);

2025-05-12_10-53-24.png

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

I would suggest utilizing X/Y Origin() and X/Y Range() in cases like this

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt << new column("R", Numeric, Continuous, Formula(Row()));

ar4 = [12.5, 22.5, 33.5];

gb = dt << Graph Builder(
	Size(534, 456),
	Show Control Panel(0),
	Variables(X(:R), Y(:height), Y(:weight)),
	Elements(Position(1, 1), Line(X, Y, Legend(11))),
	Elements(Position(1, 2), Bar(X, Y, Legend(14)))
);

Eval(EvalExpr(
	Report(gb)[FrameBox(2)] << Add Graphics Script(
		For Each({v}, Expr(ar4),
			Pen Color("red");
			Line Style("dashed");
			Line({v, Y Origin()}, {v, Y Origin() + Y Range()});
		);
	)
));
-Jarmo

View solution in original post

14 REPLIES 14
txnelson
Super User

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

I would use 

     << Add Graphics Script()

and use the JMP Graphic Primitives' to draw the lines you need

Jim
lala
Level IX

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

Thank you very much!I want to know how to implement it with a script?I would like to receive your help

 

Thank Jim!

hogi
Level XIII

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

hogi_0-1747027470737.png

 

hogi
Level XIII

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

hogi_1-1747027519230.png

 

hogi
Level XIII

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

Maybe better: invert the problem:
put a huge white rectangle into the plots where you DON'T want the lines - and move this layer on top of the lines.

 

This gives you the flexibility to adjust the lines via the GUI.

lala
Level IX

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

2025-05-12_13-55-21.png

AI I only use grok3、
Using other ais to complete JSL is basically a waste of time.

dt = Open("$SAMPLE_DATA/Big Class.jmp");ca="row";New Column(ca);Column(ca)<<Formula( row() );dt<<run formulas;Column(ca)<<deleteFormula;
ar4 = [12.5, 22.5, 33.5];
p1=dt<< Graph Builder(
	Size(534, 456),
	Show Control Panel(0),
	Variables(X(:row), Y(:height), Y(:weight)),
	Elements(Position(1, 1), Line(X, Y, Legend(11))),
	Elements(Position(1, 2), Bar(X, Y, Legend(14))),
	SendToReport(
		Dispatch({}, "Graph Builder", FrameBox(2),
			{Reference Line Order(3),
			Add Graphics Script(
				2,
				Description(""),
				PenColor("red");
				LineStyle("dashed");
				ForEach({ref_line}, ar4, Line({ref_line, 0}, {ref_line, 160}));
			)}
		)
	)
);

 

hogi
Level XIII

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

hogi_0-1747114021040.png

harsh statement.

 

I have the feeling that every second day there is a another breakthrough and old findings have to be revised.

txnelson
Super User

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

txnelson_0-1747027800276.png

Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
// New column: Column 6
Data Table( "Big Class" ) << New Column( "Column 6",
	Numeric,
	"Continuous",
	Format( "Best", 12 )
);


// Change column name: Column 6 → row
Data Table( "Big Class" ):Column 6 << Set Name( "row" );


// Change column formula: row
Data Table( "Big Class" ):row << Set Formula( Row() );
Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :row ), Y( :height ), Y( :weight ) ),
	Elements(
		Position( 1, 1 ),
		Line( X, Y, Legend( 11 ) ),
		Smoother( X, Y, Legend( 10 ) )
	),
	Elements( Position( 1, 2 ), Bar( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", FrameBox( 2 ),
			{Add Graphics Script(
				2,
				Description( "" ),
				Pen Color( "red" ):line style( "dashed" );
				Line( {11, 0}, {11, 160} );
			)}
		),
		Dispatch( {}, "400", LegendBox,
			{Legend Position( {11, [2], 10, [0], 5, [1]} )}
		)
	)
);
Jim
lala
Level IX

Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?

Thank Jim!

dt = Open("$SAMPLE_DATA/Big Class.jmp");ca="row";New Column(ca);Column(ca)<<Formula( row() );dt<<run formulas;Column(ca)<<deleteFormula;
p1 = dt << Graph Builder(
	Size(572, 501),
	Variables(X(:row), Y(:height), Y(:weight)),
	Elements(Position(1, 1), Line(X, Y, Legend(11))),
	Elements(Position(1, 2), Bar(X, Y, Legend(14))),
	SendToReport(
		Dispatch({}, "Graph Builder", FrameBox(2),
			{Reference Line Order(3),
			Add Graphics Script(
				2,
				Description(""),
				PenColor("red");
				LineStyle("dashed");
				Line({10.5, 0}, {10.5, 160});
				Line({20.5, 0}, {20.5, 160});
				Line({30.5, 0}, {30.5, 160});
			)}
		)
	)
);

Recommended Articles