BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
t75wez1
Quartz | Level 8

Hello,

 

I've been using "Proc gplot" a lot to create SAS graphs. I can decide the font, size  and color of X or Y lables and values by using statement below.

 

"axis2 label=(h=1 ' ') order=('15Jan2010'd to '15Dec2015'd by month) major=(color=black height=1.5pt) minor=none value=(height=1.5 color=gray) offset=(1,1);"

 

But how to do the same things in "proc sgplot"?

 

I'm really appreciative of any helps!

 

Ethan

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The axis statements for SGPLOT are inside of the procedure. For example, assuming your axis statement in your post would translate to something like the following for the X axis:

 

 

proc sgplot data=whatever;
xaxis display=(nolabel) values=('15Jan2010'd to '15Dec2015'd by month)
  valueattrs=(color=gray size=12pt) offsetmin=0.1 offsetmax=0.1;

...more statements...

run;

 

In SGPLOT, there are up to four axis statements: XAXIS, YAXIS, X2AXIS, and Y2AXIS. Plots can be assigned to different axes.

 

On the axis statements: LABELATTRS=(color= family= size= weight= style=)

VALUEATTRS (for the tick values) has the same options.

 

 

Hope this helps!

Dan

View solution in original post

5 REPLIES 5
DanH_sas
SAS Super FREQ

The axis statements for SGPLOT are inside of the procedure. For example, assuming your axis statement in your post would translate to something like the following for the X axis:

 

 

proc sgplot data=whatever;
xaxis display=(nolabel) values=('15Jan2010'd to '15Dec2015'd by month)
  valueattrs=(color=gray size=12pt) offsetmin=0.1 offsetmax=0.1;

...more statements...

run;

 

In SGPLOT, there are up to four axis statements: XAXIS, YAXIS, X2AXIS, and Y2AXIS. Plots can be assigned to different axes.

 

On the axis statements: LABELATTRS=(color= family= size= weight= style=)

VALUEATTRS (for the tick values) has the same options.

 

 

Hope this helps!

Dan

t75wez1
Quartz | Level 8

Thanks Dan.

But I still don't know how to change the font, size and color for label.

 

DanH_sas
SAS Super FREQ

On the axis statements: LABELATTRS=(color= family= size= weight= style=)

VALUEATTRS (for the tick values) has the same options.

ballardw
Super User

Which version of SAS are you using? Options have changed significantly with each release related to the statistical graphs (SGPlot SGPanel SGrender).

t75wez1
Quartz | Level 8

I have 9.3 1M2 and 9.4 1M3 loaded on two desktops.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 29088 views
  • 1 like
  • 3 in conversation