BookmarkSubscribeRSS Feed
Takamini
Calcite | Level 5

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;

2 REPLIES 2
Jay54
Meteorite | Level 14

Add to ROWAXIS:

  rowaxisopts=(offsetmin=0 linearopts=(tickvaluepriority=true) label='Mean Time' griddisplay=on linearopts=(viewmax=value)) ;

Takamini
Calcite | Level 5

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2590 views
  • 0 likes
  • 2 in conversation