proc template;
define statgraph swimmer_doses_gtl;
begingraph / ;
/* creating an attribute map for future swimmer bars */
discreteattrmap name = 'bar_gtl';
value 'Head and neck' / fillattrs = (color= lightgreen) lineattrs = (color = black);
value 'Melanoma' / fillattrs = (color= cyan) lineattrs = (color = black);
value 'Bladder' / fillattrs = (color= purple) lineattrs = (color = black);
value 'Non-Small Cell Lung' / fillattrs = (color= gold) lineattrs = (color = black);
value 'Prostate' / fillattrs = (color= green) lineattrs = (color = black);
value 'Cervix' / fillattrs = (color= blue) lineattrs = (color = black);
value 'Malignant pleural mesothelioma (MPM)' / fillattrs = (color= pink) lineattrs = (color = black);
value 'Colon/Rectum' / fillattrs = (color= red) lineattrs = (color = black);
value 'Other, specify' / fillattrs = (color= brown) lineattrs = (color = black);
enddiscreteattrmap;
discreteattrvar attrvar = swimmer_doses_bar var = dose attrmap = 'bar_gtl';
/* creating an attribute map for future time-point responses */
discreteattrmap name = 'time_point_response_gtl';
value 'CR' / markerattrs = (color = black symbol = SquareFilled);
value 'PR' / markerattrs = (color = black symbol = CircleFilled);
value 'SD' / markerattrs = (color = black symbol = TriangleFilled);
value 'PD' / markerattrs = (color = black symbol = TriangleLeftFilled);
value 'NE' / markerattrs = (color = black symbol = StarFilled);
enddiscreteattrmap;
discreteattrvar attrvar = time_point_responses var = time_point_eval attrmap =
'time_point_response_gtl';
layout overlay
/
xaxisopts = (
type = linear
offsetmin =0.38 type=linear offsetmax = 0.08
label = 'Treatment Duration (days)'
labelattrs = (family = 'Arial' size = 10 pt)
linearopts = (tickvaluesequence = (start = 0 end = 250
increment = 10))
tickvalueattrs = (family = 'Arial' size = 10 pt)
)
yaxisopts = (
type = discrete
display = (label)
reverse = true
offsetmin = 0.125 offsetmax = 0.08
/*offsetmin = 0.125 offsetmax = 0.08*/
label = 'Subject (Treatment)'
labelattrs = (family = 'Arial' size = 10 pt)
)
/* second horizontal axis is needed for displaying patient ID */
x2axisopts = (
display = none
offsetmin = 0 offsetmax = 0
linearopts = (viewmin = 0 viewmax = 100)
)
;
/* drawing bars for duration of different dosages */
highlowplot
y = needed_order
low = dose_st_day
high = dose_en_day
/
type = bar
group = swimmer_doses_bar
outlineattrs = (pattern=solid)
barwidth = 0.50
name = 'dosages'
highcap=ongocap
;
/* drawing text information about subject ID */
scatterplot
x = id_subject_left
y = needed_order
/
xaxis = x2
datalabel = id_subject
datalabelposition = right
markerattrs = (size = 0)
datalabelattrs = (size = 9 pt color = black)
;
/* drawing markers to indicate time-point responses */
scatterplot
x = evald
y = needed_order
/
group = time_point_responses
name = 'responses'
markerattrs = (size = 6 pt);
/* Legend */
discretelegend 'responses'
/
location = inside
exclude = (' ')
halign = right
valign = bottom
border = false
down = 1
title = "Response:"
titleattrs = (size = 10 pt )
valueattrs = (size = 9 pt)
order=rowmajor
across=1
;
discretelegend 'dosages'
/
location = inside
exclude = (' ')
halign = right
valign = 0.1
border = false
down = 1
title = "Tumor Type:"
titleattrs = (size = 10 pt )
valueattrs = (size = 9 pt)
order=rowmajor
across=1
;
endlayout;
endgraph;
end;
run;
Hi ,
Too much space creating at bottom and left side of swimmer plot and further when I give footnote graph is shrinking and text overlapping. Any help is appreciated. Thanks.
The blank space you have around the graph is outside the definition of the graph. Check your ODS RTF destination or any ODS LAYOUT settings. Also, I suggest you could use the LOWLABEL of the HighLow plot itself for the subject id. Or, an AxisTable.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.