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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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