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

How do I change the Graph Frame box Outline color and add a box around legend?

Hello!
I am trying to make the top and right border on the attached graph black and size 2 to make it publication quality. I am able to toggle it on and off using Right click -> Graph -> Border though. I checked the properties as well and I am unable to see a option to change it.

Additionally, I want to put a outline around the Legend frame box if possible?
Thanks!401_pGaN_Si_dev_cycle1_and_2_ELW_Calculations - Graph Builder.png

2 REPLIES 2
jthi
Super User

Re: How do I change the Graph Frame box Outline color and add a box around legend?

So you have JMP graph in which you have legend set inside the graph like this

jthi_0-1744450342570.png

and you wish to add box around the legend? With scripting you can send message << Border(15) for example to add black borders like this

jthi_1-1744450517690.png

 

View more...
Names Default To Here(1); 

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

gb = dt << Graph Builder(
	Legend Position("Inside Right"),
	Variables(X(:weight), Y(:height), Color(:sex)),
	Elements(Points(X, Y, Legend(3)), Smoother(X, Y, Legend(5))),
	SendToReport(
		Dispatch({}, "400", ScaleBox,
			{Legend Model(
				5,
				Base(0, 0, 1, Item ID("Smooth", 1)),
				Properties(0, {Line Color(-9939840)}, Item ID("Smooth", 1))
			)}
		),
		Dispatch({}, "400", LegendBox, {Set Title("Legend")})
	)
);

Report(gb)[LegendBox(1)] << Border(15);

I assume border follows same "numbering" as Border Box and you can find info from here Scripting Guide > Display Trees > Construct Custom Windows > Construct Display Boxes for New Window... . I think after you do this once, you can save it as a preset and then use the preset for other graph builders if necessary

 

-Jarmo

Re: How do I change the Graph Frame box Outline color and add a box around legend?

Jarmo said:

> I assume border follows same "numbering" as Border Box

 

I would suggest using <<Border(1) rather than <<Border(15).  The general Border property works like Padding and Margin, except that currently only 1-pixel borders are currently supported.  If that were to change, a setting of 15 might be a bit surprising!

You can also explicitly use <<Border(Left(1), Top(1), Right(1), Bottom(1)) to make it more clear.  When a single value is used, it applies to all sides.

Recommended Articles