Data visualization with SAS programming

PROC GBARLINE with multiple bar?

Reply
Occasional Contributor
Posts: 9

PROC GBARLINE with multiple bar?

Is it possibile to create a graph with proc gbarline with 2 BAR statements?
Thanks
MPaola
SAS Super FREQ
Posts: 864

Re: PROC GBARLINE with multiple bar?

No, but it is possible to do this with PROC SGPLOT if you have SAS 9.2. What version of SAS are you running?
Occasional Contributor
Posts: 9

Re: PROC GBARLINE with multiple bar?

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
SAS Super FREQ
Posts: 864

Re: PROC GBARLINE with multiple bar?

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
Occasional Contributor
Posts: 9

Re: PROC GBARLINE with multiple bar?

Perfect Dan!
Thanks a lot. I will read your papers!
MPaola
Post a Question
Discussion Stats
  • 4 replies
  • 371 views
  • 0 likes
  • 2 in conversation