cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Thierry_S
Super User

JSL - Graph Builder - Capture FrameBox and Axis Boxes without labels, title, and legend?

Hi JMP Community,

I'm working on a simple JSL script that assembles multiple plots into a 6 x 5 grid. While I get acceptable results by capturing the plot area using the following line of code: img = gbr[FrameBox (1)] << get picture; where gbr is a Graph Builder report, I have not been able to find the right item to call in the Tree Structure to also capture the axis values (without the labels; see below an approximation of what I'd like to capture). Is there a direct capture method that I could use or do I need to capture the entire plot structure and "delete the unwanted elements? Or, is there a completely different method you would suggest?

 

Annotation 2020-09-20 225333.png

Thank you for your help.

Best,

TS

Thierry R. Sornasse
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL - Graph Builder - Capture FrameBox and Axis Boxes without labels, title, and legend?

Here is one approach......I attempted to use "Remove Axis Label" on the graph builder window, but it failed to work.  So I had to get a bit more specific.

listbox.PNG

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

gb = Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Line Of Fit( X, Y, Legend( 8 ) ) )
);

gbr = gb << report;
gbr[LegendBox(1)]<<delete;
gbr[GraphBuilderComponentBox(1)][TextEditBox(1)]<<set text("");
gbr[GraphBuilderTitleBox(3)][TextEditBox(1)]<<set text("");
gbr[GraphBuilderTitleBox(4)][TextEditBox(1)]<<set text("");

nwj=new window("The Picture",<<journal);
nwj<<append(gbr[ListBox(2)]<<get picture);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: JSL - Graph Builder - Capture FrameBox and Axis Boxes without labels, title, and legend?

Here is one approach......I attempted to use "Remove Axis Label" on the graph builder window, but it failed to work.  So I had to get a bit more specific.

listbox.PNG

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

gb = Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Line Of Fit( X, Y, Legend( 8 ) ) )
);

gbr = gb << report;
gbr[LegendBox(1)]<<delete;
gbr[GraphBuilderComponentBox(1)][TextEditBox(1)]<<set text("");
gbr[GraphBuilderTitleBox(3)][TextEditBox(1)]<<set text("");
gbr[GraphBuilderTitleBox(4)][TextEditBox(1)]<<set text("");

nwj=new window("The Picture",<<journal);
nwj<<append(gbr[ListBox(2)]<<get picture);
Jim
Thierry_S
Super User

Re: JSL - Graph Builder - Capture FrameBox and Axis Boxes without labels, title, and legend?

Hi Jim,
Thanks for the solution, it works exactly as advertised with the Big Class example but it returns some unexpected results when I run it on my specific plot elements: I will have to look in more details for the right graphic element to capture after the unwanted elements are peeled off.
Best,
TS
Thierry R. Sornasse