BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
swannie
Obsidian | Level 7

Hi,

 

I'm working on the attached swim lane plot using the code also attached.  The anno2 dataset in the code creates the current arrowheads using the "arrow" function, but it doesn't have any options to increase the size.  I would like the "ongoing" arrowheads at the end of the time on study bars to be larger, but haven't found any way to do that.  I'm using SAS 9.4 and would appreciate any help with this issue.

 

Swannie

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

You really do not need any annotation at all.  See attached code and graph.

Just like you used scatter plot to render the circle, you can do the same for the arrowhead.

The legend is automatically built for you.  You can easily reorder the entries if needed.

 

Swim_Lane_2.png

 

proc format;
  value recist
    1='RECIST v1.1 Response'
    2='Stable by RECIST v1.1'
    3='RECIST v1.1 Progression';
run;

data tos;
  set data.swim_lane;
  if ongoing='y' then loc=tos+2;
run;

ods graphics / reset imagename='Swim_Lane_2';
proc sgplot data=tos ;
   format group recist.;
   hbarparm category=subjn response=tos/group=group barwidth=1.0 dataskin=sheen;		
   scatter X=ttrc Y=subjn /markerattrs=(symbol=circlefilled size=12 color=black) filledoutlinedmarkers
           markerfillattrs=(color=white) markeroutlineattrs=(color=black) legendlabel='RECIST v1.1 Confirmed Response';
   scatter y=subjn x=loc / markerattrs=(symbol=trianglerightfilled size=24) legendlabel='Active Follow-up';
   keylegend / location=inside position=bottomright noborder across=1 valueattrs=(size=14) autoitemsize;
   yaxis type=discrete display=(noline novalues noticks nolabel) labelattrs=(size=18 weight=bold);
   xaxis type=linear labelattrs=(size=14 weight=bold) VALUEATTRS= (Weight=Bold) label="Weeks" values=(0 to 80 by 8) offsetmin=0;
run;

 

View solution in original post

7 REPLIES 7
Jay54
Meteorite | Level 14

If you are using SGPLOT, you have many ways to do the arrow.  You can use the HighLow plot that has a built in arrowhead.  Or overlay a SCATTER with the arrow type symbols.  You can adjust the size as you want. 

 

http://blogs.sas.com/content/graphicallyspeaking/2014/06/22/swimmer-plot/

 

swannie
Obsidian | Level 7

Thanks for the quick response, but is there some way to do this that doesn't involve reprogramming the dataset and production code?  I'd prefer not to have to go back and do that at this point.

Swannie

Jay54
Meteorite | Level 14

Please attach your code with some sample data so we can run it to see what you are doing.  What release of SAS (including maintenance level) are you using?

swannie
Obsidian | Level 7

Hmmm.  I tried to attach both the figure and the code in my first post.  Is there some trick to attaching more than one file?  Seems like there is, because I can only get one at a time to work.  I put the files in a .zip file; hoping that works.

 

Thanks for your help!
Swannie 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

What code are you using?  I would guess either style or proc template update.  You may even find an example at:

http://blogs.sas.com/content/graphicallyspeaking/

Jay54
Meteorite | Level 14

You really do not need any annotation at all.  See attached code and graph.

Just like you used scatter plot to render the circle, you can do the same for the arrowhead.

The legend is automatically built for you.  You can easily reorder the entries if needed.

 

Swim_Lane_2.png

 

proc format;
  value recist
    1='RECIST v1.1 Response'
    2='Stable by RECIST v1.1'
    3='RECIST v1.1 Progression';
run;

data tos;
  set data.swim_lane;
  if ongoing='y' then loc=tos+2;
run;

ods graphics / reset imagename='Swim_Lane_2';
proc sgplot data=tos ;
   format group recist.;
   hbarparm category=subjn response=tos/group=group barwidth=1.0 dataskin=sheen;		
   scatter X=ttrc Y=subjn /markerattrs=(symbol=circlefilled size=12 color=black) filledoutlinedmarkers
           markerfillattrs=(color=white) markeroutlineattrs=(color=black) legendlabel='RECIST v1.1 Confirmed Response';
   scatter y=subjn x=loc / markerattrs=(symbol=trianglerightfilled size=24) legendlabel='Active Follow-up';
   keylegend / location=inside position=bottomright noborder across=1 valueattrs=(size=14) autoitemsize;
   yaxis type=discrete display=(noline novalues noticks nolabel) labelattrs=(size=18 weight=bold);
   xaxis type=linear labelattrs=(size=14 weight=bold) VALUEATTRS= (Weight=Bold) label="Weeks" values=(0 to 80 by 8) offsetmin=0;
run;

 

swannie
Obsidian | Level 7

Fantastic!  Very elegant solution.  Thanks very much, Swann

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1361 views
  • 0 likes
  • 3 in conversation