- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have the below code which is working for keeping all figures in one page, How ever because of the busy data, the graph doesnt show up. Hence I would need to split this into two pages(may me into more pages) . Can anyone help with this?
proc template;
define statgraph seriesplot ;
begingraph/ designwidth=1100 designheight=640 border = off;
layout lattice / pad=0 rows = 4 columns = 1 ;*rowdatarange = union columndatarange = union rowgutter = 5 columngutter = 5 rowweights= (1) columnweights = (.555 .445);
layout overlay /
xaxisopts=(label="Interval Post-dose" labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015
linearopts = ( tickvaluelist=(1 2 3 7 14 21 28 42 56 70 84 115) tickdisplaylist=('D1' 'D2' 'D3' 'Wk1/D7' 'Wk2/D14' 'Wk3' 'Wk4/Mnth1' 'Wk6' 'Wk8' 'Wk10' 'Wk12' 'Wk52/EOS')
tickvaluefitpolicy=rotate TICKVALUEROTATION =diagonal ))
yaxisopts=(label="Stool (vg/g)" type=log logopts=(base=2 minorticks=false ) labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015);
seriesplot x=visnx y=med_1/ group=studyid name="series" lineattrs=(pattern=1);
ScatterPlot X=visnx Y=med_1 / Group=studyid YErrorUpper=p25_1 YErrorLower=p75_1 NAME="scatter" errorbarattrs=(pattern=1 ) ;
*referenceline x=24/ lineattrs=(pattern=mediumdash ) ;
discretelegend "series" / across=1 down=3 location=inside halign=right valign=top border=false valueattrs=(size=8 ) ;
endlayout;
layout overlay /
xaxisopts=(label="Interval Post-dose" labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015
linearopts = ( tickvaluelist=(1 2 3 7 14 21 28 42 56 70 84 115) tickdisplaylist=('D1' 'D2' 'D3' 'Wk1/D7' 'Wk2/D14' 'Wk3' 'Wk4/Mnth1' 'Wk6' 'Wk8' 'Wk10' 'Wk12' 'Wk52/EOS')
tickvaluefitpolicy=rotate TICKVALUEROTATION =diagonal ))
yaxisopts=(label="Urine (vg/ml)" type=log logopts=(base=2 minorticks=false ) labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015);
seriesplot x=visnx y=med_2/ group=studyid name="series" lineattrs=(pattern=1);
ScatterPlot X=visnx Y=med_2 / Group=studyid YErrorUpper=p25_2 YErrorLower=p75_2 NAME="scatter" errorbarattrs=(pattern=1 ) ;
*referenceline x=24/ lineattrs=(pattern=mediumdash ) ;
discretelegend "series" / across=1 down=3 location=inside halign=right valign=top border=false valueattrs=(size=8 ) ;
endlayout;
layout overlay /
xaxisopts=(label="Interval Post-dose" labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015
linearopts = ( tickvaluelist=(1 2 3 7 14 21 28 42 56 70 84 115) tickdisplaylist=('D1' 'D2' 'D3' 'Wk1/D7' 'Wk2/D14' 'Wk3' 'Wk4/Mnth1' 'Wk6' 'Wk8' 'Wk10' 'Wk12' 'Wk52/EOS')
tickvaluefitpolicy=rotate TICKVALUEROTATION =diagonal ))
yaxisopts=(label="Saliva (vg/ml)" type=log logopts=(base=2 minorticks=false ) labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015);
seriesplot x=visnx y=med_3/ group=studyid name="series" lineattrs=(pattern=1);
ScatterPlot X=visnx Y=med_3 / Group=studyid YErrorUpper=p25_3 YErrorLower=p75_3 NAME="scatter" errorbarattrs=(pattern=1 ) ;
*referenceline x=24/ lineattrs=(pattern=mediumdash ) ;
discretelegend "series" / across=1 down=3 location=inside halign=right valign=top border=false valueattrs=(size=8 ) ;
endlayout;
layout overlay /
xaxisopts=(label="Interval Post-dose" labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015
linearopts = ( tickvaluelist=(1 2 3 7 14 21 28 42 56 70 84 115) tickdisplaylist=('D1' 'D2' 'D3' 'Wk1/D7' 'Wk2/D14' 'Wk3' 'Wk4/Mnth1' 'Wk6' 'Wk8' 'Wk10' 'Wk12' 'Wk52/EOS')
tickvaluefitpolicy=rotate TICKVALUEROTATION =diagonal ))
yaxisopts=(label="Nasal Swab (vg/swab)" type=log logopts=(base=2 minorticks=false ) labelattrs=(size=9pt) tickvalueattrs=(size=8) offsetmin = 0.015 offsetmax = 0.015);
seriesplot x=visnx y=med_4/ group=studyid name="series" lineattrs=(pattern=1);
ScatterPlot X=visnx Y=med_4 / Group=studyid YErrorUpper=p25_4 YErrorLower=p75_4 NAME="scatter" errorbarattrs=(pattern=1 ) ;
*referenceline x=24/ lineattrs=(pattern=mediumdash ) ;
discretelegend "series" / across=1 down=3 location=inside halign=right valign=top border=false valueattrs=(size=8 ) ;
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=in template=seriesplot dattrmap=myattr;
dattrvar studyid="studyid";
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I believe the issue here is that you've create a lattice that is four cells high and one cell wide, but your set the the designHEIGHT to be a small 640px and the designWIDTH a lot larger. This setting probably prevents the graph from drawing due to space. Try swapping your designwidth and designheight values and see if you get the graph to appear.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
sorry ,I meant proc template
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You would also have to provide example data of your In and Myattr datasets to even have a chance of diagnosing behavior. The data is best provided as a working data step. The data doesn't have to be the same but should demonstrate the same behavior.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Below is the attib data that im using.
data myattr;
length id $8 value $40 linecolor $ 6 markercolor $6 textcolor $6;
id='studyid';value='AAA102';linecolor='blue';linepattern=1; markersymbol='circlefilled';markercolor='blue';textcolor='blue';output;
id='studyid';value='BBB123';linecolor='red';linepattern=1; markersymbol='circlefilled';markercolor='red';textcolor='red';output;
id='studyid';value='CCC234';linecolor='green';linepattern=1; markersymbol='circlefilled';markercolor='green';textcolor='green';output;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I believe the issue here is that you've create a lattice that is four cells high and one cell wide, but your set the the designHEIGHT to be a small 640px and the designWIDTH a lot larger. This setting probably prevents the graph from drawing due to space. Try swapping your designwidth and designheight values and see if you get the graph to appear.
Hope this helps!