I am achieving a series plot with markers in GTL:
proc template ;
define statgraph series_scatter ;
dynamic _X
_Y
_Curve
_Group
;
begingraph
/ border = false
datacolors = ( Black
Red
Blue
Aqua
Magenta
Orange
)
datalinepatterns = ( Solid
ShortDash
MediumDash
LongDash
MediumDashShortDash
DashDashDot
DashDotDot
Dash
LongDashShortDash
Dot
ThinDot
ShortDashDot
MediumDashDotDot
)
datasymbols = ( CircleFilled
TriangleFilled
TriangleDownFilled
DiamondFilled
SquareFilled
Plus
x
Asterisk
Circle
Triangle
TriangleDown
Diamond
Square
)
axisbreaktype = axis
axisbreaksymbol = bracket
;
layout overlay
/
xaxisopts = ( label = "Time (Days)"
type = linear
linearopts = ( tickvaluelist = ( 0 1 2 3 4 7 14 28 )
tickdisplaylist = ( "Baseline" "Day 1" "Day 2" "Day 3" "Day 4" "Day 7" "Day 14" "Day 28" )
)
offsetmin = 0.05
offsetmax = 0.05
)
yaxisopts = ( label = "Label"
/* type = linear*/
linearopts = ( includeranges = ( 0 - 90 820 - 840 ))
offsetmin = 0.025
offsetmax = 0.025
)
;
seriesplot x = _X
y = _Y
/ group = _Group
name = "series"
/* primary = true */
;
scatterplot x = _X
y = _Y
/ group = _Group
name = "scatter"
markerattrs = ( size = 5 )
;
referenceline y = 0
/ lineattrs = ( thickness = 1
color = black
pattern = dash
)
curvelabel = "LLN = 0"
;
referenceline y = 60
/ lineattrs = ( thickness = 1
color = black
pattern = dash
)
curvelabel = "ULN = 60"
;
mergedlegend "scatter"
"series"
/ border = true
title = " "
;
endlayout ;
endgraph ;
end ;
run ;
ods listing close ;
options orientation = landscape topmargin = 0.75in bottommargin = 0.75in rightmargin = 0.75in leftmargin = 0.75in ;
ods results ;
ods rtf file = "~\test.rtf" style = styles.custom nogtitle nogfootnote ;
ods graphics on
/ height = 3.5in
width = 9in
border = off
;
proc sgrender
data = &outsas.
template = series_scatter
;
dynamic _X = "avisit"
_Y = "aval"
_Group = "subjid"
;
by studyid
dose
;
run ;
ods rtf close ;
ods listing ;
The issue is that the Days are evenly spaced as if nominal:
If I add TYPE = LINEAR (uncomment above), then I get the following:
WARNING: SERIESPLOT statement has a conflict with the axis type. The plot will not be drawn.
WARNING: SCATTERPLOT statement has a conflict with the axis type. The plot will not be drawn.
I have tried changing the order of SERIESPLOT and SCATTERPLOT statements and added PRIMARY = TRUE to the the SERIESPLOT. Any corrections, references, or suggestions are welcomed.
Thank you,
Kevin
Can't test anything without data.
Did you try commenting out the TYPE=LINEAR for the XAXISOPTS?
Doh!
The issue is that I used the WRONG variable for _X:
data test ;
retain studyid "1"
dose "1"
;
length subjid $ 4 ;
do subjid = "1" , "2" , "Mean" ;
do avisitn = 0 , 1 , 2 , 3 , 4 , 7 , 14 , 28 ;
aval = 10 * ranuni( 1 ) ;
output ;
end ;
end ;
run ;
proc sgrender
data = test
template = series_scatter
;
dynamic _X = "avisitn"
_Y = "aval"
_Group = "subjid"
;
by studyid
dose
;
run ;
AVISIT is the character version of AVISITN.
Now, I am on to other (real) issues 🙂
Many thanks,
Kevin
Glad you found the solution.
I wish I could say I haven't made a similar mistake of variable name in the past year sometime. Wish, can't say it truthfully...
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.