Data visualization with SAS programming

re: title inside graph

Accepted Solution Solved
Reply
Regular Contributor
Posts: 228
Accepted Solution

re: title inside graph

[ Edited ]

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;


Accepted Solutions
Solution
‎09-22-2016 02:46 PM
SAS Super FREQ
Posts: 925

Re: re: title inside graph

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


All Replies
Trusted Advisor
Posts: 1,459

Re: re: title inside graph

Please upload a screenshot of your result/graph.

Regular Contributor
Posts: 228

Re: re: title inside graph

Hi...I included the output graph.

Trusted Advisor
Posts: 1,459

Re: re: title inside graph

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
SAS Super FREQ
Posts: 925

Re: re: title inside graph

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.

Regular Contributor
Posts: 228

Re: re: title inside graph

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.

Solution
‎09-22-2016 02:46 PM
SAS Super FREQ
Posts: 925

Re: re: title inside graph

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;

Regular Contributor
Posts: 228

Re: re: title inside graph

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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