Dear Experts,
This is a questions with regard to the x axis labels i want to put in the graph where there is scatter plot and box plot jiterred.
i have written the following code
data class;
set sashelp.class;
age2=age-0.2;
run;
proc format fmtlib ;
value ns 10-11='1'
11<-12='2'
12<-13='3'
13<-14='4'
14<-15='5'
15<-16='6'
;
run;
proc template ;
define statgraph scatterbox ;
begingraph ;
layout overlay / xaxisopts=(linearopts=(VIEWMIN=10 tickvaluesequence=(start=10 end=16 increment=1)));
boxplot x=age y=height / xaxis=x ;
scatterplot x=age2 y=height / xaxis=x ;
endlayout;
endgraph;
end ;
proc sgrender data=class template=scatterbox ;
format age ns.;
run ;
the graph generated is as below
The scatter plot and box plot are aligned side by side. However the issue i have is with the x axis label, i should assign the label as shown in blue and that label should be between the scatter plot and box plot as labelled.
could you please help me to get it.
Thanks,
Jag
Please ALWAYS include the release of SAS you are running. Thanks for including the full program with data.
If you are running SAS 9.3 or later, you can user DiscreteOffset to place a scatter and a box side by side using GTL. You can use the same variable for X or Category, The variable can be either discrete or a numeric column with a format.
Please ALWAYS include the release of SAS you are running. Thanks for including the full program with data.
If you are running SAS 9.3 or later, you can user DiscreteOffset to place a scatter and a box side by side using GTL. You can use the same variable for X or Category, The variable can be either discrete or a numeric column with a format.
Thank you Sanjay! it worked.
i am working on sas 9.3.
Regards,
Jag
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.