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

Hi...I am new to using any of the graphing procedures and I am having difficulty getting the titles to appear inside the graph and having a legend included to distinguish different years for each month as the data contains 3 different years of Sales. Any help would be greatly appreciated....Thanks.

 

goptions reset=all border cback=white htitle=12pt ;

 

title 'Customer Sales';

title2 h=10pt 'Cost Per Customer - Monthly Average';

 

axis1 order=('Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' 'Jan' 'Feb' 'Mar') label=(f="Arial/Bold" 'Month') offset=(5,5) width=1 ;

axis2 order=(600 to 1100 by 100) label=none major=(height=1.5) minor=(height=1) width=1;

legend1 label=(position=(bottom center));

 

proc gplot data=cost_per_customer;

   bubble Total_Amount_Paid*Month1=num / haxis=axis1 vaxis=axis2 vminor=1 blabel bsize=12 bfill=solid bscale=area bcolor=bgr;

 

run;

quit;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Instead of GPLOT, try SGPLOT as an alternative:

 

title 'Customer Sales';
title2 h=10pt 'Cost Per Customer - Monthly Average';

proc sgplot data=cost_per_customer;
xaxis values=('Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' 'Jan' 'Feb' 'Mar') label='Month';
yaxis values=(600 to 1100 by 100) display=(nolabel) minor minorcount=1;
bubble y=Total_Amount_Paid x=Month1 size=num / group=year;
run;
quit;

View solution in original post

7 REPLIES 7
Shmuel
Garnet | Level 18

Please upload a screenshot of your result/graph.

twildone
Pyrite | Level 9

Hi...I included the output graph.

Shmuel
Garnet | Level 18

I have very little experience with graphics.

I understand that you want to move the titles into the graph frame.

 

Attached is a screenshot of MOVE= option (from SAS online doc.) that can be used with Tiltles, Footnotes and Notes.

Check if it helps.


Gmove-option.JPG
DanH_sas
SAS Super FREQ

It's not clear which ODS destination you're using, but trying specifying GTITLE on the destination statement to see if that make s a difference. AS for the grouping question, it is difficult to answer without knowing you data structure. Can you post your list of variables?

 

Thanks!

Dan.

twildone
Pyrite | Level 9

Hi Dan.....the list of variables I have are:

Year

Total Amount Paid

Month1 ( name of month)

num ( Number of Customers)

 

I would like the bubbles for each month to represent the year that the bubble is associated with and to have the number of customers as bubble label included. Thanks.

DanH_sas
SAS Super FREQ

Instead of GPLOT, try SGPLOT as an alternative:

 

title 'Customer Sales';
title2 h=10pt 'Cost Per Customer - Monthly Average';

proc sgplot data=cost_per_customer;
xaxis values=('Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' 'Jan' 'Feb' 'Mar') label='Month';
yaxis values=(600 to 1100 by 100) display=(nolabel) minor minorcount=1;
bubble y=Total_Amount_Paid x=Month1 size=num / group=year;
run;
quit;

twildone
Pyrite | Level 9

Thanks Dan...it worked perfectly!!!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 3537 views
  • 0 likes
  • 3 in conversation