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.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 558 views
  • 2 likes
  • 2 in conversation