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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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