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

Dear all,

I have a plot with connected symbols. Is it possible to write the vaxis value on top of each symbol like in this example?

plot_sum_on_symbol.gif

I know it is possible with prog gchart... vbar. You simply write sum into the vbar statement. I tried it with the plot statement but get the error that the syntax is not correct.

Best wishes

Eva


1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

You can use Proc Gplot's "pointlabel" for that.  By default, it uses the y-value as the label (which is what you want, I believe?).  You can also customize the label, and use another variable if you want.

symbol1 value=dot interpol=none pointlabel;

proc gplot data=sashelp.class;

plot height*weight=1;

run;

View solution in original post

6 REPLIES 6
GraphGuy
Meteorite | Level 14

You can use Proc Gplot's "pointlabel" for that.  By default, it uses the y-value as the label (which is what you want, I believe?).  You can also customize the label, and use another variable if you want.

symbol1 value=dot interpol=none pointlabel;

proc gplot data=sashelp.class;

plot height*weight=1;

run;

Eva
Quartz | Level 8 Eva
Quartz | Level 8

Dear Robert,

thanx. I would never have googled for "pointlabel" 🙂 It works. And foundit now in the sas help.

Best wishes

Eva

Eva
Quartz | Level 8 Eva
Quartz | Level 8

I formatted the variable I user for the pointlabel now in commax10.2

Unfortunately then the values on the y-axis are also in this format. Can I use a different format for the values on an axis?

GraphGuy
Meteorite | Level 14

That's where the "You can also customize the label, and use another variable if you want" comes in, such as ...

data my_data; set sashelp.class;

my_text=put(height,commax10.2);

run;

symbol1 value=dot interpol=none pointlabel=('#my_text');

proc gplot data=my_data;

plot height*weight=1;

run;

Eva
Quartz | Level 8 Eva
Quartz | Level 8

Unfortunately not supported by activex. Like axis split='...' is not 😞

GraphGuy
Meteorite | Level 14

Ahh - you hadn't mentioned you were using Activex!

A lot of little things aren't supported in dev=Activex (and dev=Java), and you are quite likely to bump into these when creating custom graphs.  Therefore, I always recommend that people creating custom graphs use dev=png.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 6 replies
  • 1470 views
  • 0 likes
  • 2 in conversation