BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi!

I have a basic question I hope someone can help me with. I want to create a plot where symbols equal another variable (an ID variable). Thanks on beforehand!

(I've tried to search the forum for an answer, but I couldn't find one. I hope I didn't miss any thread.)

Best regards,
Helen
7 REPLIES 7
Paige
Quartz | Level 8
plot y*x=symbolvar;
deleted_user
Not applicable
Thanks - I would like to have the first four letters as symbol and only manages to get the first one.
ArtC
Rhodochrosite | Level 12
Here is a simplistic solution using ANNOTATE. There are a number of possible refinements depending on your needs.

[pre]
data anndat(keep=xsys ysys x y function text position);
set sashelp.class(rename=(name=text));
retain xsys ysys '2' function 'label' position '2';

x=weight; y=height; output anndat;
run;

symbol1 v=dot color=blue;
proc gplot data=sashelp.class anno=anndat;
plot height * Weight;
run;
quit;
[/pre]
Paige
Quartz | Level 8
HelenSAS: are you talking about PROC GPLOT or PROC PLOT?
deleted_user
Not applicable
Thanks for your kind help!

I am trying to use Proc plot.

At the moment I just written

plot x*y=varname;

but would like to get the whole varname or at least 4 letters as symbol instead of just the first one.

Thanks for the code given! I am a little unsure as to how to use it, though. *sigh* I haven't tried to use plot before.
deleted_user
Not applicable
Thanks! Found it: plot x*y $ labelvar;

Can't get only 4 letters but at the moment I'm happy as it is.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1693 views
  • 0 likes
  • 3 in conversation