BookmarkSubscribeRSS Feed
SantosCarvajal
Calcite | Level 5

Dear community,

 

   I am trying to obtain Figure 1 (see attached document). However when I am using proc template Figure 2 is produced.

   Please find below the code that I am using:

 


data means;
 set means;
 label mean = "Mean +/- SEM";
 elower = mean - stderr;
 eupper = mean + stderr;
run;

 

proc template;
   define statgraph mygraphs.meanover;
   begingraph;
     entrytitle "Mean Measurement Over Time" ;

 

     discreteattrmap name='filling' / ignorecase=true;
     value 'A'     / markerattrs=(symbol=square color = black size = 12);

     enddiscreteattrmap;
     discreteattrvar attrvar=classmrk var=armcd attrmap='filling';

  

     layout overlay;

       scatterplot x = rep y = mean / group = classmrk name = "treat" yerrorlower = elower yerrorupper = eupper;
     endlayout;
  endgraph;
 end;
run;

proc sgrender data=means template=mygraphs.meanover;
run;

 

   I tried to modify the color of the square BUT I did not find the way of filling the square with a color in order to be overlaid

   on top of the mean and SEM bars.

   Thank you in advance

   Regards

 

Santos

 

2 REPLIES 2
DanH_sas
SAS Super FREQ

Use the FILLEDOUTLINEDMARKERS=TRUE option on the SCATTERPLOT statement. You must use this option with a filled marker. You can then control the fill and outline independently. In your case, you have a grouped scatter where you just want to "fill the hole" with the wall color. Use the following options on the SCATTERPLOT statement.

 

filledoutlineedmarkers=true markerfillattrs=(color=GraphWalls:color)

 

and change the "square" to "squarefilled" in your attrmap.

 

Hope this helps!

Dan

SantosCarvajal
Calcite | Level 5

Hi Dan,

 

   Thank you very much. It works perfectly.

   Next step: Using the proposed solution, I am going to mixed filled and cleared symbols in the same graphic using GTL.

   Wish me luck

   Regards

 

Santos

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 885 views
  • 2 likes
  • 2 in conversation