BookmarkSubscribeRSS Feed
MPaola
Calcite | Level 5
Is it possibile to create a graph with proc gbarline with 2 BAR statements?
Thanks
MPaola
4 REPLIES 4
DanH_sas
SAS Super FREQ
No, but it is possible to do this with PROC SGPLOT if you have SAS 9.2. What version of SAS are you running?
MPaola
Calcite | Level 5
I use SAS 9.2.
I need to include in the same graph: 2 bars and 3 lines.
Is it possible with a PROC SGPLOT? If yes, where can i find a good paper which teachs me using PROC SGPLOT?

Thanks for help
MPaola
DanH_sas
SAS Super FREQ
Hey MPaola,

The documentation for the SG procedures should help a lot. You can also go to the support site and search for "Dan Heath" to find a number of related papers I've written. In the meantime, here is a very simplistic example to demonstrate barline overlays:

[pre]
proc sgplot data=sashelp.class;
y2axis min=0;
vbar age / response=weight;
vbar age / response=height barwidth=0.5;
vline age / response=weight y2axis lineattrs=GraphData1(thickness=2);
vline age / response=height y2axis lineattrs=GraphData2(thickness=2);
run;
[/pre]

Hope this helps,
Dan
MPaola
Calcite | Level 5
Perfect Dan!
Thanks a lot. I will read your papers!
MPaola

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