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

I want to annotate a footnote on the graph using sgplot, with a line break between the first and the second lines of the annotated footnote, so that the results look like this:

 

annotated_footnote.PNG

 

Below is my unsuccessful attempt at doing so:

 

ods graphics / width=6in height=4in;


data anno_footnote1;
length function $10 anchor $20 drawspace $20;
function='text';
drawspace='GraphPercent';
x1=11; y1=4;
label= "NOTE: First line of annotated footnote.";
textcolor='gray77'; textsize=8;
width=100;
run;

data anno_footnote2;
length function $10 anchor $20 drawspace $20;
function='text';
drawspace='GraphPercent';
x2=11; y2=2;
label="SOURCES: Second line of annotated footnote.";
textcolor='gray77'; textsize=8;
width=5000;
run;

data anno_footnote;
	set anno_footnote1 anno_footnote2;
run;

proc sgplot data=sashelp.class noautolegend uniform=all sganno=anno_footnote;

bubble x=age y=height size=Weight / group=Sex;


run;
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @KRA15,

 

Try this:

data anno_footnote;
length function $10 anchor $20 drawspace $20 label $60;
anchor='bottomleft';
function='text';
drawspace='GraphPercent';
textcolor='gray77'; textsize=8;
width=100;
x1=1; y1=4;
label="NOTE: First line of annotated footnote.";
output;
x1=1; y1=0;
label="SOURCES: Second line of annotated footnote.";
output;
run;

proc sgplot data=sashelp.class noautolegend uniform=all sganno=anno_footnote pad=(bottom=10 pct);
bubble x=age y=height size=Weight / group=Sex;
run;

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @KRA15,

 

Try this:

data anno_footnote;
length function $10 anchor $20 drawspace $20 label $60;
anchor='bottomleft';
function='text';
drawspace='GraphPercent';
textcolor='gray77'; textsize=8;
width=100;
x1=1; y1=4;
label="NOTE: First line of annotated footnote.";
output;
x1=1; y1=0;
label="SOURCES: Second line of annotated footnote.";
output;
run;

proc sgplot data=sashelp.class noautolegend uniform=all sganno=anno_footnote pad=(bottom=10 pct);
bubble x=age y=height size=Weight / group=Sex;
run;
PGStats
Opal | Level 21

I get decent looking results with:

 

ods graphics / width=6in height=4in;


data anno_footnote;
length function $10 drawspace $20 label $100;
function='text';
drawspace='GraphPercent';
textcolor='gray77'; textsize=7; anchor="left";
width=100;

x1=5; y1=5;
label= "NOTE: First line of annotated footnote.";
output;

x1=5; y1=2;
label="SOURCES: Second line of annotated footnote.";
output;

run;

proc sgplot data=sashelp.class noautolegend uniform=all sganno=anno_footnote;
bubble x=age y=height size=Weight / group=Sex;
run;
PG

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
  • 2 replies
  • 1601 views
  • 2 likes
  • 3 in conversation