Choose Language Hide Translation Bar
Highlighted
twaintwist
Community Trekker

Change Font size within Graph?

Is there anyway to change the font size for the x or y axis and title of the Graph within the GraphBuilder script?

0 Kudos
2 ACCEPTED SOLUTIONS

Accepted Solutions
mpb
Super User mpb
Super User

Re: Change Font size within Graph?

Try this script against the fitness data.  I still don't know if it's possible to change the font of a grouping variable, but this code will change the right hand axis if it's used for a secondary Y axis.

Graph Builder(

    Variables(

        X( :Runtime ),

        Y( :Oxy ),

        Y( :Weight, Position( 1 ), Side( "Right" ) )

    ),

    Elements(

        Points( X, Y( 1 ), Legend( 1 ) ),

        Smoother( X, Y( 1 ), Legend( 3 ) ),

        Points( X, Y( 2 ), Legend( 6 ) ),

        Smoother( X, Y( 2 ), Legend( 7 ) )

    ),

    SendToReport(

        Dispatch( {}, "Runtime", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Oxy", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Weight", ScaleBox, {Tick Font( size( 14 ) )} ),

        Dispatch( {}, "graph title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "X title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Y r title", TextEditBox, {Set Font Size( 14 )} )

    )

);

View solution in original post

0 Kudos
mpb
Super User mpb
Super User

Re: Change Font size within Graph?

dt = open("$Sample_Data/fitness.jmp")

Interactively: Help>Sample Data>See an alphabetical list of all sample files>fitness

In Graph Builder drag Runtime to the horizontal axis. Then select Oxy and Weight and drag the pair to the left Y axis. Right click on the y-axis label and choose "Move Right", then pick the one you want to have on the right. After that you can right click the right axis label and change axis settings.

Michael

View solution in original post

0 Kudos
6 REPLIES 6
mpb
Super User mpb
Super User

Re: Change Font size within Graph?

In Graph Builder right click the axis you want to modify. Choose Axis Settings and in the resulting dialog box very near the top and to the right is a Font button where you can change the font settings. When done finish up with Graph Builder and in the resulting plot open the red triangle pulldown menu and choose Script>Save Script to Script Window to see how to script the font change.

Hmmm, don't see how to change the Title or the Axis Labels ....

Ok, run this script against the fitness data. It seems to work and may help you figure out more general mods.

Graph Builder(

    Show Control Panel( 0 ),

    Variables( X( :Runtime ), Y( :Oxy ) ),

    Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 3 ) ) ),

    SendToReport(

        Dispatch( {}, "Oxy", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Oxy", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Runtime", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Runtime", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Oxy vs. Runtime", TextEditBox, {Set Font Size( 16 )} )

    )

);

0 Kudos
twaintwist
Community Trekker

Re: Change Font size within Graph?

mpb ----  thanks --- I can't seem to get 'Axis Settings' to appear for the righthand Y-axis -----    it appears for the lefthand axis but the font settings only change the tick mark font attributes but not the axis label....

0 Kudos
mpb
Super User mpb
Super User

Re: Change Font size within Graph?

Try this script against the fitness data.  I still don't know if it's possible to change the font of a grouping variable, but this code will change the right hand axis if it's used for a secondary Y axis.

Graph Builder(

    Variables(

        X( :Runtime ),

        Y( :Oxy ),

        Y( :Weight, Position( 1 ), Side( "Right" ) )

    ),

    Elements(

        Points( X, Y( 1 ), Legend( 1 ) ),

        Smoother( X, Y( 1 ), Legend( 3 ) ),

        Points( X, Y( 2 ), Legend( 6 ) ),

        Smoother( X, Y( 2 ), Legend( 7 ) )

    ),

    SendToReport(

        Dispatch( {}, "Runtime", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Oxy", ScaleBox, {Tick Font( size( 16 ) )} ),

        Dispatch( {}, "Weight", ScaleBox, {Tick Font( size( 14 ) )} ),

        Dispatch( {}, "graph title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "X title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 16 )} ),

        Dispatch( {}, "Y r title", TextEditBox, {Set Font Size( 14 )} )

    )

);

View solution in original post

0 Kudos
twaintwist
Community Trekker

Re: Change Font size within Graph?

mpb...  thanks ----  I was able to change the 'title' font with my data but not the "Y r title" -----     and I can't seem to find the Fitness.jmp datatable --- can you point me to it? ----then I'll try your script which will likely point me to where I'm going wrong

thanks

0 Kudos
mpb
Super User mpb
Super User

Re: Change Font size within Graph?

dt = open("$Sample_Data/fitness.jmp")

Interactively: Help>Sample Data>See an alphabetical list of all sample files>fitness

In Graph Builder drag Runtime to the horizontal axis. Then select Oxy and Weight and drag the pair to the left Y axis. Right click on the y-axis label and choose "Move Right", then pick the one you want to have on the right. After that you can right click the right axis label and change axis settings.

Michael

View solution in original post

0 Kudos
twaintwist
Community Trekker

Re: Change Font size within Graph?

Michael ---- thanks ----- I didn't think to look in the Samples folder ----- (dope slap to myself)......

the script works fine and I see how the titles for the axis' are changing with font change... ---- THANKS

0 Kudos