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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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