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;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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