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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1269 views
  • 0 likes
  • 2 in conversation