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 )}
)
)
);

Automation and ScriptingWindowsRe: 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
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!
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?
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.
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?
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]} )}
)
)
);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></FORMULA>Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?
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></FORMULA>
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()});
);
)
));Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?
harsh statement.
I have the feeling that every second day there is a another breakthrough and old findings have to be revised.
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?After running the code, the chart appears, but an error message is displayed. Log:
Name Unresolved: For Each in access or evaluation of 'For Each' , For Each(
{v},
[12.5, 22.5, 33.5],
Pen Color( "red" );
Line Style( "dashed" );
Line( {v, Y Origin()}, {v, Y Origin() + Y Range()} );
) /*###*/
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?What version of JMP are you using. For each() was first implemented in JMP 16
Here is a version of the code that will work for JMP 15 and earlier
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(
Eval Expr(
Report( gb )[FrameBox( 2 )] << Add Graphics Script(
For( i = 1, i <= N Items( ar4 ), i++,
v = ar4[i];
Pen Color( "red" );
Line Style( "dashed" );
Line( {v, Y Origin()}, {v, Y Origin() + Y Range()} );
)
)
)
);Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?V14.3, it is too old...
Re: Can the vertical dividing line of the X-axis in the drawing only show part of it?JMP 14 was released in March of 2018. Yes, it is pretty old. However, The code I provided works in JMP 14