The following program is printng all text and numbers in unbolded font. How can I have it print everything in bold. Also, the bars are printed on the top of the symbol. Can I have the symbol printed on the top of the bar? Also, is there a way to have a "blank" line inserted in-between certain bars? Here is the data and program I am using?
data x;
input sname $15. AGM LL UL ns2 na2;
format AGM LL UL f5.1;
datalines;
SCOT: Males 233.1 182.9 297.1 12 12
SCOT: Females 241.3 189.1 307.9 11 11
SCOT: NHW 218.4 170.8 279.4 10 10
SCOT: NHB 294.1 232.8 371.5 9 9
SCOT: HISP 217.9 167.0 284.3 8 8
SCOT: OTH 226.1 174.2 293.4 7 7
NNAL: Males 258.0 162.1 410.7 6 6
NNAL: Females 360.5 226.7 573.3 5 5
NNAL: NHW 334.9 214.9 522.0 4 4
NNAL: NHB 258.5 157.0 425.5 3 3
NNAL: HISP 324.1 202.9 517.8 2 2
NNAL: OTH 308.3 189.9 500.6 1 1
;
run;
title 'Adjusted Geometric Means with 95% Confidence Intervals';
proc sgplot data=x noautolegend nocycleattrs;
refline 150 600 / axis=x;
scatter y=ns2 x=agm / markerattrs=graphdata2
(symbol=circlefilled size=15 color=black);
highlow y=ns2 low=ll high=ul / type=bar intervalbarwidth=.05in
nooutline fillattrs=graphdata1 (color=Green);
yaxistable sname / y=ns2 position=left location=outside
nolabel valuejustify=left pad=(right=0px) labelattrs=(weight=bold);
yaxistable agm LL UL / y=nS2 position=right location=inside
labelhalign=center labelattrs=(weight=bold)
pad=(left=20px right=10px);
yaxis display=none offsetmin=0.1 offsetmax=0.05 values=(1 to 12) ;
run;
Ram Jain
Ram,
Sometimes in life "size matters", but in ODS Graphics "order matters"!
The following code has been updated to:
data x;
length sname1 sname2 $7. sname $15.;
input sname1 sname2 AGM LL UL ns2 na2;
format AGM LL UL f5.1;
sname = strip(sname1) || ' ' || strip(sname2);
datalines;
SCOT: Males 233.1 182.9 297.1 12 12
SCOT: Females 241.3 189.1 307.9 11 11
SCOT: NHW 218.4 170.8 279.4 10 10
SCOT: NHB 294.1 232.8 371.5 9 9
SCOT: HISP 217.9 167.0 284.3 8 8
SCOT: OTH 226.1 174.2 293.4 7 7
NNAL: Males 258.0 162.1 410.7 6 6
NNAL: Females 360.5 226.7 573.3 5 5
NNAL: NHW 334.9 214.9 522.0 4 4
NNAL: NHB 258.5 157.0 425.5 3 3
NNAL: HISP 324.1 202.9 517.8 2 2
NNAL: OTH 308.3 189.9 500.6 1 1
;
run;
title 'Adjusted Geometric Means with 95% Confidence Intervals';
proc sgplot data=x noautolegend nocycleattrs;
refline 150 600 / axis=x;
highlow y=ns2 low=ll high=ul / type=bar intervalbarwidth=.05in
nooutline fillattrs=graphdata1 (color=Green);
scatter y=ns2 x=agm / markerattrs=graphdata2
(symbol=circlefilled size=15 color=black);
yaxistable sname / y=ns2 position=left location=outside
nolabel valuejustify=left pad=(right=0px) labelattrs=(weight=bold);
yaxistable agm LL UL / y=nS2 position=right location=inside
labelhalign=center labelattrs=(weight=bold)
pad=(left=20px right=10px);
yaxis display=none offsetmin=0.1 offsetmax=0.05 values=(1 to 12);
run;
Enjoy!................Phil
PS. Look for "Philip R Holland" on Amazon - you may enjoy that too! ![]()
Ram,
A few amendments marked in red to match your specification:
data x;
infile datalines truncover;
length sname1 sname2 $7. sname $15.;
input sname1 sname2 AGM LL UL ns2 na2;
format AGM LL UL f5.1;
if sname1 ne '-' then sname = strip(sname1) || ' ' || strip(sname2);
datalines;
SCOT: Males 233.1 182.9 297.1 13 13
SCOT: Females 241.3 189.1 307.9 12 12
SCOT: NHW 218.4 170.8 279.4 11 11
SCOT: NHB 294.1 232.8 371.5 10 10
SCOT: HISP 217.9 167.0 284.3 9 9
SCOT: OTH 226.1 174.2 293.4 8 8
- - . . . 7 7
NNAL: Males 258.0 162.1 410.7 6 6
NNAL: Females 360.5 226.7 573.3 5 5
NNAL: NHW 334.9 214.9 522.0 4 4
NNAL: NHB 258.5 157.0 425.5 3 3
NNAL: HISP 324.1 202.9 517.8 2 2
NNAL: OTH 308.3 189.9 500.6 1 1
;
run;
options missing = ' ';
title 'Adjusted Geometric Means with 95% Confidence Intervals';
proc sgplot data=x noautolegend nocycleattrs;
refline 150 600 / axis=x;
highlow y=ns2 low=ll high=ul / type=bar intervalbarwidth=.05in
nooutline fillattrs=graphdata1 (color=Green);
scatter y=ns2 x=agm / markerattrs=graphdata2
(symbol=circlefilled size=15 color=black);
yaxistable sname / y=ns2 position=left location=outside
nolabel valuejustify=left pad=(right=0px) labelattrs=(weight=bold)
valueattrs = (weight=bold)
;
yaxistable agm LL UL / y=nS2 position=right location=inside
labelhalign=center labelattrs=(weight=bold)
valueattrs = (weight=bold)
pad=(left=20px right=10px);
yaxis display=none offsetmin=0.1 offsetmax=0.05 values=(1 to 13);
run;
Does that work for you now?................Phil
PS. BTW you don't use na2 anywhere in this program!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.