Below is my program to generate a figure.
I would like to fix maximum value for y axis in bar chart .
For example, to fix max=100 for yaxis.
How should I revise my program by using sas 9.3?
proc template;
define statgraph TMT1;
begingraph;
entrytitle 'Part B - Total Time (seconds)';
layout gridded / border=false;
layout datalattice columnvar=visit / headerlabeldisplay=value cellwidthmin=50
columnheaders=bottom border=false columndatarange=union
columnaxisopts=(/*display=(line tickvalues)*/ label='Treatment' )
rowaxisopts=(offsetmin=0 linearopts=(tickvaluepriority=true) label='Mean Time' griddisplay=on) ;
layout prototype / walldisplay=(fill);
barchart x=TRT y=mu / group=TRT
name='bar' outlineattrs=(color=black);
scatterplot x=TRT y=mu / group=TRT yerrorlower=lower
yerrorupper=upper
markerattrs=(size=0) name='scatter'
errorbarattrs=(thickness=2) datatransparency=0.6;
scatterplot x=TRT y=pvalue1 / group=TRT
markerattrs=(size=10) name='Two sample t -visit' markerattrs=(symbol=Circle size=10);
scatterplot x=TRT y=pvalue2 / group=TRT
markerattrs=(size=10) name='Two sample t -change from baseline' markerattrs=(symbol=CircleFilled size=10);
scatterplot x=TRT y=pvalue3 / group=TRT
markerattrs=(size=10) name='Two sample t -change from baseline' markerattrs=(symbol=x size=10);
scatterplot x=TRT y=pvalue4 / group=TRT
markerattrs=(size=10) name='ANOVA-visit' markerattrs=(symbol=Diamond size=10);
scatterplot x=TRT y=pvalue5 / group=TRT
markerattrs=(size=10) name='ANOVA-change from baseline' markerattrs=(symbol=DiamondFilled size=10);
scatterplot x=TRT y=max / group=TRT
markerattrs=(size=0) name='max'
datatransparency=0.6 YAXIS=Y;
endlayout;
endlayout;
endlayout;
endgraph;
end;
run;
Add to ROWAXIS:
rowaxisopts=(offsetmin=0 linearopts=(tickvaluepriority=true) label='Mean Time' griddisplay=on linearopts=(viewmax=value)) ;
Hi Sanjay,
Thanks for your reply.
But I found a issue that I tried to fix the maximum as 24, the maximum still present as 25.
proc template;
define statgraph ESS;
begingraph;
entrytitle 'Total Score';
layout gridded / border=false;
layout datalattice columnvar=visit / headerlabeldisplay=value cellwidthmin=50
columnheaders=bottom border=false columndatarange=union
columnaxisopts=(/*display=(line tickvalues)*/ label='Treatment' )
rowaxisopts=(offsetmin=0 linearopts=(tickvaluepriority=true) label='Mean Score' griddisplay=on linearopts=(viewmax=24)) ;
layout prototype / walldisplay=(fill);
barchart x=TRT y=res9_mean / group=TRT
name='bar' outlineattrs=(color=black);
scatterplot x=TRT y=res9_mean / group=TRT yerrorlower=res9_lclm
yerrorupper=res9_uclm
markerattrs=(size=0) name='error bar'
errorbarattrs=(thickness=2) datatransparency=0.6 DATALABELPOSITION=TOPRIGHT;
scatterplot x=TRT y=marker / group=TRT
markerattrs=(size=10) name='scatter' markerattrs=(symbol=x size=10);
scatterplot x=TRT y=max / group=TRT
markerattrs=(size=0) name='max'
datatransparency=0.6 YAXIS=Y;
endlayout;
endlayout;
endlayout;
endgraph;
end;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.