cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Thierry_S
Super User

Changing Font Type and Size within a GraphBuilder > Customize > Script?

Hi JMP Community,

 

I have a problem with a short script associated with a Graph Builder customization that aims at adding annotations to a bar graph. Specifically, I'm trying to adjust the font type and size in this script but I'm getting an error message: Name Unresolved: Font in access or evaluation of 'Font' , Font( "Arial Narrow" ) /*###*/

For( i = 0, i < 46, i = i + 2,
	Text (
		Center Justified,
		{i + 0.5, 0.85},
		"p: " || Char( Format( Column( dt, 8 )[i + 1], "PValue" ) ),
		Font ("Arial Narrow"),
		Font Size (6)
	) 
);

Of note: without the Font (), and Font Size elements, the script works

 

Thank you for your help.

 

TS

Thierry R. Sornasse
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

Names Default to Here( 1 );

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

gb = dt << Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

gbr = gb << Report;

gbr[FrameBox(1)] << Add Graphics Script(
	Text Font( "Arial" );
	Text Size( 24 );
	Text( { 55, 150 }, "Hello, world!" );
);

View solution in original post

5 REPLIES 5

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

You call Text Font() and Font Size() before calling Text(). They are not arguments to Text(). See this help.

Thierry_S
Super User

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

Hi MArk,

Thank you for your help (as always). I was able to define the font size using Text Size (n) but I could not get the Text Font () command to work. I'm working with JMP 14.1 and the specific short script is part of a Graph Builder customization: is there specific commands that cannot be used in such GB scripts?

Thanks,

TS
Thierry R. Sornasse

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

Names Default to Here( 1 );

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

gb = dt << Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

gbr = gb << Report;

gbr[FrameBox(1)] << Add Graphics Script(
	Text Font( "Arial" );
	Text Size( 24 );
	Text( { 55, 150 }, "Hello, world!" );
);
Thierry_S
Super User

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

Hi Mark,
It looks like I jump the gun: the command Text Font ("arial") is still producing an error in JMP 14.1:
Name Unresolved: Text Font in access or evaluation of 'Text Font' , Text Font( "Arial" ) /*###*/
It looks like the font type cannot be changed/updated within a Graphics Script at least in JMP 14.1

Thanks for your help.
Best,
TS
Thierry R. Sornasse
txnelson
Super User

Re: Changing Font Type and Size within a GraphBuilder > Customize > Script?

The JMP 14 Scripting Index does not show any option to change the Font in the Add Graphics or Graph Box environment.
Jim