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.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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