cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How to add special tags on top of this mapping?

For example, we use Big Class.jmp data to make height and weight distribution maps according to different ages.
Can you show the starting and ending heights of different ages in the table in the order of row numbers?
Of course, there is no limit to how it can be displayed.Screenshots just make the requirements clear.

Thanks!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ca = "R";
New Column( ca );
Column( ca ) << Formula( Row() );
dt << run formulas;
Column( ca ) << deleteFormula;
d2 = dt << Summary( Group( age ), Freq( 0 ), Weight( 0 ), Link to original data table( 0 ) );
d2 << Update( With( dt ), Match Columns( age = age ), Add Columns from Update table( height ) );
Column( d2, 3 ) << set name( "end" );
dt << Sort( By( R ), Order( Descending ), replace table );
d2 << Update( With( dt ), Match Columns( age = age ), Add Columns from Update table( height ) );
Column( d2, 4 ) << set name( "beg" );
dt << Sort( By( R ), Order( Ascending ), replace table );
d2 << delete columns( 2 );
dt << Update( With( d2 ), Match Columns( age = age ) );

2023-11-13_14-48-26.png

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to add special tags on top of this mapping?

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "name") << Label(0);
Column(dt, "height") << Label(1);

dt << Select Where(Row() == Col Min(Row(), :age)) << Label(1) << Colors("Red") << Clear Select;
dt << Select Where(Row() == Col Max(Row(), :age)) << Label(1) << Colors("Blue") << Clear Select;

gb = dt << Graph Builder(
	Variables(X(:weight), Y(:height), Group X(:age), Color(:sex)),
	Elements(
		Bar(X, Y, Legend(6), Response Axis("X")),
		Points(X, Y, Color(0), Legend(7), Summary Statistic("Mean"))
	),
	SendToReport(
		Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(0, {Marker("Pipe"), Marker Size(0), Transparency(0)}, Item ID("Mean", 1))
			)}
		)
	)
);
-Jarmo

View solution in original post

8 REPLIES 8
jthi
Super User

Re: How to add special tags on top of this mapping?

I'm confused what you wish to display and where: tags on mapping? starting and ending heights in the table? Red arrow? Green checkmark?

-Jarmo
lala
Level VII

Re: How to add special tags on top of this mapping?

Thanks!

p1=dt<<Graph Builder(
	Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
	Elements( Bar( X, Y, Legend( 8 ), Response Axis( "X" ) ) )
);

2023-11-13_15-37-47.png

jthi
Super User

Re: How to add special tags on top of this mapping?

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "name") << Label(0);
Column(dt, "height") << Label(1);

dt << Select Where(Row() == Col Min(Row(), :age)) << Label(1) << Clear Select;
dt << Select Where(Row() == Col Max(Row(), :age)) << Label(1) << Clear Select;

gb = dt << Graph Builder(
	Variables(X(:weight), Y(:height), Group X(:age), Color(:sex)),
	Elements(
		Bar(X, Y, Legend(6), Response Axis("X")),
		Points(X, Y, Color(0), Legend(7), Summary Statistic("Mean"))
	),
	SendToReport(
		Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(0, {Marker("Pipe"), Marker Size(0), Transparency(0)}, Item ID("Mean", 1))
			)}
		)
	)
);
-Jarmo
lala
Level VII

Re: How to add special tags on top of this mapping?

Thanks Experts!

 

This marked number can be further added with different colors or other distinctions.Enable to know which is the beginning and which is the end?

2023-11-13_15-44-16.png

jthi
Super User

Re: How to add special tags on top of this mapping?

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "name") << Label(0);
Column(dt, "height") << Label(1);

dt << Select Where(Row() == Col Min(Row(), :age)) << Label(1) << Colors("Red") << Clear Select;
dt << Select Where(Row() == Col Max(Row(), :age)) << Label(1) << Colors("Blue") << Clear Select;

gb = dt << Graph Builder(
	Variables(X(:weight), Y(:height), Group X(:age), Color(:sex)),
	Elements(
		Bar(X, Y, Legend(6), Response Axis("X")),
		Points(X, Y, Color(0), Legend(7), Summary Statistic("Mean"))
	),
	SendToReport(
		Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(0, {Marker("Pipe"), Marker Size(0), Transparency(0)}, Item ID("Mean", 1))
			)}
		)
	)
);
-Jarmo
lala
Level VII

Re: How to add special tags on top of this mapping?

I added the total weight for each age to the graph so that the original marks don't show up again.How to modify the code.
Still need to consult an expert.Thanks!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d2=dt<<Summary(Group(age),sum(height),Freq("无"),Weight("无"),Link to original data table(0));
dt<<Update(With(d2),Match Columns(age=age));
Column(dt, "name") << Label(0);Column(dt, "height") << Label(1);
dt << Select Where(Row() == Col Min(Row(), :age)) << Label(1) << Colors("Red") << Clear Select;
dt << Select Where(Row() == Col Max(Row(), :age)) << Label(1) << Colors("Blue") << Clear Select;
 
gb = dt <<  Graph Builder(
Variables(
X( :weight ),
Y( :height ),
Y( :"Sum(height)"n ),
Group X( :age ),
Color( :sex )
),
Elements(
Bar( X, Y, Legend( 5 ), Response Axis( "X" )),
Points(X, Y, Color(0), Legend(7), Summary Statistic("Sum"))
)
,
SendToReport(
Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Properties(0, {Marker("Pipe"), Marker Size(0), Transparency(0)}, Item ID("Mean", 1))
)}
)
)
,
Elements(
Position( 1, 2 ),
Bar( X, Y, Legend( 6 ),
Response Axis( "X" ),
Summary Statistic( "Max" ),
Label( "Label by Value" )
)
)
) ;

2023-11-13_18-00-17.png

jthi
Super User

Re: How to add special tags on top of this mapping?

Open the graph builders control panel and modify different variables for different plots to figure out what is possibly wrong.

-Jarmo
lala
Level VII

Re: How to add special tags on top of this mapping?

2023-11-13_18-20-10.png