- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I see this following bar chart that made by SAS viya I guss. Wonder if this can be done in PC SAS? Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can probably do something very close to this using ODS LAYOUT GRIDDED
But, do I have an example? No I don't.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@PaigeMiller is correct. To create multiple bar charts with different response variables in one graph, you would need to use either the Graph Template Language (GTL), or use ODS LAYOUT with the SG procedures (SGPLOT in this case). If you were using the same response variable with multiple classifiers, your best option is to use the SGPANEL procedure.
ODS LAYOUT is normally applied at the page level. However, there is a trick for generating the output via ODS PRINTER such all of the output is generated in one image. I talk about this technique more in-depth in this blog post . The example below demonstrates this technique using bar charts.
ods _all_ close;
options nodate nonumber;
options leftmargin="0.001in" rightmargin="0.001in";
options papersize=(7.35in 2.00in);
title "Car Statistics";
ods printer printer=png300 file="cars.png" style=htmlblue;
ods layout gridded columns=3 advance=proc
column_gutter=0.1in row_gutter=0.1in;
ods graphics / width=2.25in noborder;
title;
proc sgplot data=sashelp.cars noopaque;
yaxis grid;
vbar origin / response=horsepower fillattrs=GraphData1 transparency=0.5;
run;
proc sgplot data=sashelp.cars noopaque;
yaxis grid;
vbar origin / response=mpg_city fillattrs=GraphData2 transparency=0.5;
run;
proc sgplot data=sashelp.cars noopaque;
yaxis grid;
vbar origin / response=mpg_highway fillattrs=GraphData3 transparency=0.5;
run;
ods layout end;
ods printer close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I always learn something when you write, @DanH_sas ! 💙
Paige Miller