Hey All, I'm producing a 'butterfly graph' by-clinic, using code very like the below. My problem is that for clinics where all the providers have 0s for one of the stats I'm reporting, SAS is putting 0 smack dab in the middle of the x-axis, which looks really weird (please see attachment SGRender3.png, or run the below code to see what I'm talking about). The easiest way I can think of to fix this would be to specify min and max values for the x-axes. But I don't want to do that because the real data varies considerably by clinic, and there's no single max value I can use for every clinic that doesn't compress the provider-by-provider variation all to heck at some large proportion of the clinics. I asked this question on SAS-L and Joe Matise (god bless 'im) suggested coming and asking here. Is there some good way to keep SAS from letting that 0-value float into the center of my x-axes? Many thanks! -Roy data psa_percents ; input @1 clinic $char5. @7 provider $char15. @25 num_males75 3.0 @29 pct_overpsa 5.1 ; datalines ; north Banderas, Antonio 80 15.2 north Jolie, Angelina 45 75.5 north Bale, Christian 130 30 west Claus, Santa 225 0 west Bunny, Easter 340 0 west Cruz, Ted 89 0 run ; proc template ; define statgraph psa_butterfly ; begingraph ; layout lattice _id='lattice' / columndatarange = data columngutter = 0 rowdatarange = data rowgutter = 10 /* columnweights = (0.62 0.38) */ columns = 2 ; layout overlay _id='overlay' / yaxisopts = (gridattrs=(color=CXE8E6E8 pattern=SOLID thickness=1 ) gridDisplay = on display =(LINE TICKVALUES TICKS)) xaxisopts = (label = '# PSAs 75+' reverse = true type = linear gridDisplay = on ) ; barchart _id='bar2' x=PROVIDER y=num_males75 / name='bar2' orient = horizontal ; endlayout; layout overlay _id='overlay2' / yaxisopts=(gridattrs=(color=CXE8E6E8 pattern=SOLID thickness=1 ) gridDisplay=on display=(LINE )) xaxisopts=(label="Percent of 75+ males in panel having PSA" type=linear gridDisplay = on ); barchart _id='bar' x=PROVIDER y= pct_overpsa / name='bar' orient = horizontal ; endlayout; endlayout; endgraph; end; options orientation = landscape ; ods html path = "c:\temp" (URL=NONE) body = "deleteme.html" (title = "Axis Problems") ; proc sgrender data= psa_percents template = psa_butterfly ; by clinic ; run; ods _all_ close ;
... View more