How to plot only for the selected range of data without extracting subsets?For example, like this, I deliberately increased the data within the selected range:
Age ==14
dt=Open("$SAMPLE_DATA/Big Class.jmp");
dt<<SORT></SORT>
Thanks Experts!

Automation and ScriptingWindows回复: How to plot only for the selected range of data without extracting subsets?This is the effect of plotting after extracting the subsets

Re: How to plot only for the selected range of data without extracting subsets?Hi @lala,
You can use the local data filter (red triangle of Graph Builder options) to only plot a specific subset of your data and change it interactively.

JSL script :
Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables(
X( :NO ),
Y( :height1 ),
Y( :weight1, Position( 1 ), Side( "Right" ) )
),
Elements( Line( X, Y( 1 ), Legend( 5 ) ), Line( X, Y( 2 ), Legend( 6 ) ) ),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == 14 ),
Display( :age, N Items( 6 ) )
)
)
);
Hope this answer will help you,
Re: How to plot only for the selected range of data without extracting subsets?Thanks Experts!
Can it achieve the use of different filters simultaneously when there are multiple graphics in the same drawing interface?
I tried but failed.
Thanks!

Re: How to plot only for the selected range of data without extracting subsets?If I understood correctly, no the local data filter apply to all graphs.
However, if you're interested in 2 age groups only, you could use the age variable as a "page" variable and only display the 2 age group thanks to local data filter :

JSL script :
Graph Builder(
Size( 630, 590 ),
Show Control Panel( 0 ),
Variables(
X( :NO ),
Y( :height1 ),
Y( :weight1, Position( 1 ), Side( "Right" ) ),
Page( :age )
),
Elements( Line( X, Y( 1 ), Legend( 5 ) ), Line( X, Y( 2 ), Legend( 6 ) ) ),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == {12, 14} ),
Display( :age, N Items( 6 ) )
)
)
);
Hope this helps,
Re: How to plot only for the selected range of data without extracting subsets?Thanks!
Graph Builder(
Size(435, 1042),
Show Control Panel(0),
Variables(X(:NO), Y(:height1), Y(:weight1, Position(1)), Group Y(:age)),
Elements(Line(X, Y(1), Y(2), Legend(5)))
);
It seems that the effect of this method cannot be achieved by grouping "age" through the Y-axis.
Where( :age == {12,13, 14,15,16,17} ),

Re: How to plot only for the selected range of data without extracting subsets?One can easily generate a window that has 2 instances displayed.

Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Sort( By( age ), Order( Ascending ), replace table );
ca = "NO";
New Column( ca );
Column( ca ) << Formula(
If( Row() == 1 | age != Lag( age, 1 ),
r = Row();
1;
,
1 + Row() - r
)
);
dt << run formulas;
Column( ca ) << deleteFormula;
ca = "height1";
New Column( ca );
Column( ca ) << Formula( If( age == 14, height * 100, height ) );
dt << run formulas;
Column( ca ) << deleteFormula;
ca = "weight1";
New Column( ca );
Column( ca ) << Formula( If( age == 14, weight * 100, weight ) );
dt << run formulas;
Column( ca ) << deleteFormula;
New Window( "graphs",
V List Box(
Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :NO ), Y( :height1 ), Y( :weight1, Position( 1 ), Side( "Right" ) ) ),
Elements( Line( X, Y( 1 ), Legend( 5 ) ), Line( X, Y( 2 ), Legend( 6 ) ) ),
Local Data Filter( Add Filter( columns( :age ), Where( :age == 14 ), Display( :age, N Items( 6 ) ) ) )
);
Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :NO ), Y( :height1 ), Y( :weight1, Position( 1 ), Side( "Right" ) ) ),
Elements( Line( X, Y( 1 ), Legend( 5 ) ), Line( X, Y( 2 ), Legend( 6 ) ) ),
Local Data Filter( Add Filter( columns( :age ), Where( :age == 12 ), Display( :age, N Items( 6 ) ) ) )
);
)
);
Re: How to plot only for the selected range of data without extracting subsets?Consult an expert: What are the steps for manually creating a diagram in this way? I’ve tried several times but haven’t succeeded.
Please help again.Thanks!
Re: How to plot only for the selected range of data without extracting subsets?Hi @lala,
I will start the step-by-step by beginning from your initial script and graph :
- From the red triangle next to "Graph Builder", click on "Local Data Filter"
- Double-click on "Age", and then CTRL+click on every age value you would like to display :

- Select "Age" from the columns menu in Graph Builder and drag and drop in the "Page" zone :
- Click on "Done " to obtain your final graph :
You can read more about the graphic options and variable roles in Essential Graphing help.
Hope you'll be able to reproduce the result with these step-by-step instructions,
Re: How to plot only for the selected range of data without extracting subsets?Thank Jim!
I use this code to plot multiple stocks in the same table in this way.
The newly added K-line graph no longer has the red and green colors.
https://community.jmp.com/t5/Discussions/Presenting-stock-data-in-form-of-box-plot/td-p/322791/page/2
