Data visualization with SAS programming

Change the fontsize of title in sgplot

Reply
Contributor
Posts: 57

Change the fontsize of title in sgplot

How do I change the size of my title in sgplot. I haves used title height=12pt  "type in my title";

but it doesn't work

Any idea??

SAS Super FREQ
Posts: 1,265

Re: Change the fontsize of title in sgplot

[ Edited ]

That is the correct syntax.

 

title height=20pt "Title";
proc sgplot data=sashelp.class;
  vbar age;
run;
PROC Star
Posts: 1,190

Re: Change the fontsize of title in sgplot

Contributor
Posts: 57

Re: Change the fontsize of title in sgplot

Thanks for your reply. This method doesnt seem to work.

Title height= 20pt 'type in my title';

 

SAS Super FREQ
Posts: 806

Re: Change the fontsize of title in sgplot

Find below a code sample using a TITLE statement that changes the height as well as the color of the title.

title height=20pt color=red 'type in my title';
proc sgplot data=sashelp.cars;
  vbar type / group=origin;
run;

Please provide some more information like:

Are you running your code using SAS Enterprise Guide, SAS Studio or something else?

Which ODS destination are you using?

Is the title within the image or outside the image created by SGPLOT

Super User
Posts: 13,046

Re: Change the fontsize of title in sgplot


Anita_n wrote:

Thanks for your reply. This method doesnt seem to work.

Title height= 20pt 'type in my title';

 


Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

Which ODS destination are you sending the result to? Please post the exact code you are using as other options on the ODS destination or ODS Graphics statement have impact the results.

 

Post code in a code box opened with the forum {I} menu icon.

Contributor
Posts: 57

Re: Change the fontsize of title in sgplot

Thanks for your reply, am using SAS 9.4 and the title is within a macro

SAS Super FREQ
Posts: 806

Re: Change the fontsize of title in sgplot

Just run the code sample provided without any macro around it, do you get the desired result?

 

Maybe your macro is resetting the TITLE definition.

 

Also provide the answers to the three questions above.

Ask a Question
Discussion stats
  • 7 replies
  • 643 views
  • 0 likes
  • 5 in conversation