BookmarkSubscribeRSS Feed
Jay323
Calcite | Level 5

Hi All,

Wish someone can help me for my graph. I am trying to remove the highlighted part 24H in below graph on day 1 day 7 and day 8, but keep the 24H in day 21 section.

 

Capture.PNG

 

Following is my code:

 


proc format;
value trt 0='300mg(day1), 300mg(day7), 600mg(day8), 600mg(day21)'
1='Placebo (day1 to day 21)';
value nday 1='Day 1' 7='Day 7' 8='Day 8' 21='Day 21';
run;

 

proc template;
define statgraph datapanel;
begingraph / designwidth=9in designheight=5.9in attrpriority=none
dataColors=(red black) dataContrastColors=(red black)
dataSymbols=(squarefilled circlefilled) dataLinePatterns=(solid solid);
layout DATAPANEL classvars=(NDAY)
/ rows=1 columns=4 headerlabeldisplay=value rowdatarange=union row2datarange=union
columnaxisopts=(linearopts=(tickvaluelist=(0 1 2 8 12 24)) linearopts=(TICKVALUEFITPOLICY=none))
rowaxisopts=(LabelPosition=DataCenter
linearopts=(viewmin=-8 viewmax=12 tickvaluelist=(-8 -6 -4 -2 0 2 4 6 8 10 12)));
layout PROTOTYPE;
scatterplot x=TIME y=MEANCHG / yerrorupper=ulm yerrorlower=llm group=PLBO groupdisplay=cluster;
seriesplot x=TIME y=MEANCHG / group=PLBO groupdisplay=cluster display=(markers) name='s'
markerattrs=(size=2pct);
endlayout;

sidebar / spacefill=false;
discretelegend 's' / title='' across=1;
endsidebar;
endlayout;
endgraph;
end;
run;

*----------------------------------------------------------------------------*;
* output plot into png/rtf file. *;
*----------------------------------------------------------------------------*;
options orientation=landscape nodate nonumber leftmargin=1in rightmargin=1in topmargin=1in bottommargin=1in;
ods _all_ close;
ods rtf file="&outdir.\hr0time0plot.rtf" bodytitle nogtitle nogfootnote;
ods listing style=RTF gpath="&outdir";
ods graphics / reset noborder imagename="hr0time0plot" outputfmt=png;
title;
proc sgrender data=anal1 template=datapanel;
format PLBO trt. NDAY nday.;
run;
ods graphics off;
ods listing close;
ods rtf close;

*** need to have output destinations active;
ods listing;

1 REPLY 1
ballardw
Super User

@Jay323 wrote:

Hi All,

Wish someone can help me for my graph. I am trying to remove the highlighted part 24H in below graph on day 1 day 7 and day 8, but keep the day 2.

 

 

proc template;
define statgraph datapanel;
begingraph / designwidth=9in designheight=5.9in attrpriority=none
dataColors=(red black) dataContrastColors=(red black)
dataSymbols=(squarefilled circlefilled) dataLinePatterns=(solid solid);
layout DATAPANEL classvars=(NDAY)
/ rows=1 columns=4 headerlabeldisplay=value rowdatarange=union row2datarange=union
columnaxisopts=(linearopts=(tickvaluelist=(0 1 2 8 12 24)) linearopts=(TICKVALUEFITPOLICY=none))
rowaxisopts=(LabelPosition=DataCenter
linearopts=(viewmin=-8 viewmax=12 tickvaluelist=(-8 -6 -4 -2 0 2 4 6 8 10 12)));
layout PROTOTYPE;
scatterplot x=TIME y=MEANCHG / yerrorupper=ulm yerrorlower=llm group=PLBO groupdisplay=cluster;
seriesplot x=TIME y=MEANCHG / group=PLBO groupdisplay=cluster display=(markers) name='s'
markerattrs=(size=2pct);
endlayout;

sidebar / spacefill=false;
discretelegend 's' / title='' across=1;
endsidebar;
endlayout;
endgraph;
end;
run;

 


Please look at your tickvaluelist for the columnaxisopts. if you don't want the 24 there then don't put it in the option list.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 694 views
  • 0 likes
  • 2 in conversation