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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 789 views
  • 0 likes
  • 2 in conversation