cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

When drawing bubbles, how can I set the background color to different colors according to the number of rows?

Hello!

 

For example, set lines 1-20 and 21-40 to different background colors.

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

p1=dt<<Bubble Plot(
	X( Transform Column( "Row", Formula( Row() ) ) ),
	Y( :height ),
	Sizes( :weight ),
	Coloring( :sex ),
	Title Position( 0, 0 ),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Min( 0 ), Max( 45 ), Inc( 5 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Min( 50 ), Max( 72.5 ), Inc( 5 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Bubble Plot",
			FrameBox,
			{Frame Size( 565, 360 ), Background Color( 76 )}
		)
	)
);

2022-12-10_08-44-26.png

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

回复: When drawing bubbles, how can I set the background color to different colors according to the number of rows?

You could use reference lines with allow range enabled

Names Default To Here(1);

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

bp = dt << Bubble Plot(
	X(Transform Column("Row", Formula(Row()))),
	Y(:height),
	Sizes(:weight),
	Coloring(:sex),
	Title Position(0, 0)
);

wait(1);

axisbox = Report(bp)[axis box(2)];
axisbox << Add Ref Line({0, 20}, "Solid", "Red", "", 1, 0.25);
axisbox << Add Ref Line({20, 40}, "Solid", "Medium Light Blue", "", 1, 0.25);

Or then graphic scripts but I think reference lines with range are easier in this case.

-Jarmo

View solution in original post

3 REPLIES 3
lala
Level IX

回复: When drawing bubbles, how can I set the background color to different colors according to the number of rows?

Not work.

Fill Color("blue"); Rect( 1, 80 , 20 ,50,  1);,
jthi
Super User

回复: When drawing bubbles, how can I set the background color to different colors according to the number of rows?

You could use reference lines with allow range enabled

Names Default To Here(1);

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

bp = dt << Bubble Plot(
	X(Transform Column("Row", Formula(Row()))),
	Y(:height),
	Sizes(:weight),
	Coloring(:sex),
	Title Position(0, 0)
);

wait(1);

axisbox = Report(bp)[axis box(2)];
axisbox << Add Ref Line({0, 20}, "Solid", "Red", "", 1, 0.25);
axisbox << Add Ref Line({20, 40}, "Solid", "Medium Light Blue", "", 1, 0.25);

Or then graphic scripts but I think reference lines with range are easier in this case.

-Jarmo
lala
Level IX

回复: When drawing bubbles, how can I set the background color to different colors according to the number of rows?

Thank you for your help!

dt=Open("$SAMPLE_DATA/Big Class.jmp");
bp = dt <<Graph Builder(
	Size( 532, 453 ),
	Show Control Panel( 0 ),
	Variables(
		X( Transform Column( "Row", Formula( Row() ) ) ),
		Y( :height ),
		Color( :sex ),
		Size( :height )
	),
	Elements( Points( X, Y, Legend( 17 ) ) )
);

axisbox = Report(bp)[axis box(1)];
axisbox << Add Ref Line({0, 20}, "Solid", "Red", "", 1, 0.25);
axisbox << Add Ref Line({20, 40}, "Solid", "Medium Light Blue", "", 1, 0.25);

 

Recommended Articles