Folks,
I would like to graph the results of my analysis for a an academic paper but I'd like to be able to fit three graphs on to one word document page. Would anyone know how to amend the sample code below so the graphs would all fit neatly together so I could simply copy and paste into a word document.
Any amendments to the code below to perhaps make a better looking graph is welcome also.
Kind regards,
Sean
data sample;
input decile year Median_Admin Median_survey;
datalines;
1 2013 0.0 0.0
2 2013 0.5 0.0
3 2013 0.5 0.0
4 2013 0.8 2.1
5 2013 8.3 10.2
6 2013 13.2 16.7
7 2013 17.5 23.4
8 2013 21.1 27.9
9 2013 25.1 33.0
10 2013 30.4 39.5
1 2014 0.0 0.0
2 2014 0.0 0.0
3 2014 0.6 0.2
4 2014 0.9 2.5
5 2014 8.6 10.5
6 2014 13.5 16.9
7 2014 17.8 23.7
8 2014 21.6 27.9
9 2014 26.1 32.0
10 2014 32.4 40.5
1 2015 0.0 0.0
2 2015 0.0 0.0
3 2015 0.8 0.2
4 2015 1.9 2.5
5 2015 6.6 10.5
6 2015 13.6 14.9
7 2015 17.9 26.7
8 2015 22.8 28.9
9 2015 29.1 32.1
10 2015 35.4 40.4
;run;
title1 'Difference in Tax Amongst Deciles';
footnote1 h=3 j=l ' Source: Authours calculations'
j=r 'Note Sample data';
symbol1 color=red
interpol=join
value=dot;
symbol2 font=marker value=C
color=blue
interpol=join;
axis1 order=(1 to 10 by 1) offset=(2,2)
label=none
major=(height=2) minor=(height=1)
width=3;
axis2 order=(0 to 45 by 5) offset=(0,0)
label=none
major=(height=2) minor=(height=1)
width=3;
legend1 label=none
shape=symbol(4,2)
position=(top center inside)
mode=share;
proc gplot data=sample;
by year;
plot Median_Admin*decile Median_survey*decile / overlay legend=legend1
vref=0 to 45 by 5 lvref=2
haxis=axis1 hminor=4
vaxis=axis2 vminor=1;
run;
Step 1: Move away from gplot to a more modern graphing system - sgplot and graph template language.
Step 2: Examine the posts in this excellent blog which shows hundreds of graph types with code:
http://blogs.sas.com/content/graphicallyspeaking/
So using graph template language, you can use gridded:
Or you can use proc sgpanel:
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.