BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hi ,

 

Just want know how to anotate graph (insert the text inside the label as per below).

 

raja777pharma_0-1636734315275.png

 

 

 

I am using below code.

 

raja777pharma_1-1636734314979.png

 

 

Thank you,

Rajasekhar

2 REPLIES 2
ballardw
Super User

TEXT plot. Add variable with the text and the location you want it to the data set.

Or provide an annotate data set with that.

 

PLEASE post code in a code box (the running man or </> icon), not as a picture. First, your picture shows "code" that won't run as it clips the semicolon and we can't tell what else might be clipped from the image. Second if we need to suggest a minor change to code we can't copy/paste and edit the code. I am also not likely to retype code from an image.

Ksharp
Super User

The simplest way is using INSET statement.

 

proc sgplot data=sashelp.heart; 
 scatter y=height x=weight/markerattrs=(symbol=circlefilled size=6) transparency=0.85;
    reg y=height x=weight / lineattrs=(thickness=4 color=red ) nomarkers; 
 yaxis grid  label="ylabel";
 xaxis label="xlabel";

 inset "           70% Subject" /position=west textattrs=(color=red size=20);
 inset "30% Subject           " /position=east textattrs=(color=red size=20);

run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 799 views
  • 0 likes
  • 3 in conversation