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

hi All, 

 

I am new to communities and proc template. I could not find a way to change the mean symbol in grouped proc template boxplot. Is it possible?

I cannot post any data at this time. what I am trying to do is, display box plot of CTCAE grades for a particular analyte, I am grouping data by grade. I tried the following option but if I do that, then data is not grouped anymore. Different symbols are used for mean, not 'starfilled'. I am using SAS 9.4. Please help. 

proc template;
  define style Styles.Boxplot;
  parent = styles.statistical;
    style GraphBoxMean from GraphBoxMean /
      markersymbol=" starfilled"
      contrastcolor=GraphColors("gcdata1")
      markersize = 10px;
end;

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Try using NOGFOOTNOTE on the ODS PDF statement. This will prevent the footnotes from  being added to the plot, but I think they might get moved to the bottom of the page. Your best option to insert text right after a graph would be to use the ODS TEXT statement. Give that a try and see if that works for you.

 

Thanks!
Dan 

View solution in original post

8 REPLIES 8
Reeza
Super User

I cannot post any data at this time.

Make fake data or use a data set from SASHELP.CLASS instead so we can run the code please. 

 

Is there a specific reason you're not using the standard SGPLOT code as well? With a data attribute map, that should give you control over your symbols and if you use the TMPLOUT out option with that it'll generate the GTL code for you.

GTL can do the same thing but is usually significantly more work. 

 


@smitham wrote:

hi All, 

 

I am new to communities and proc template. I could not find a way to change the mean symbol in grouped proc template boxplot. Is it possible?

I cannot post any data at this time. what I am trying to do is, display box plot of CTCAE grades for a particular analyte, I am grouping data by grade. I tried the following option but if I do that, then data is not grouped anymore. Different symbols are used for mean, not 'starfilled'. I am using SAS 9.4. Please help. 

proc template;
  define style Styles.Boxplot;
  parent = styles.statistical;
    style GraphBoxMean from GraphBoxMean /
      markersymbol=" starfilled"
      contrastcolor=GraphColors("gcdata1")
      markersize = 10px;
end;

 


 

smitham
Fluorite | Level 6

Hi, thank yo so much for quick response. 

I am using sgplot for concentration value boxplot but I am not able to control where I place footnotes (inside, outside the grapharea). I had switch to proc template for footnotes. I will try and generate dummy data. 

Jay54
Meteorite | Level 14

You can use STYLEATTRS statement to change your symbols.  Also you can use INSET statement to place notes inside the plot.

To see different markers, you have to use a style with (or change to) ATTRPRIORITY=none.

 

ods graphics / attrpriority=none;
proc sgplot data=sashelp.cars;
styleattrs datasymbols=(circlefilled trianglefilled squarefilled);
vbox mpg_city / group=origin;
run;

 

smitham
Fluorite | Level 6

Hi Sanjay, Dan

Thank you very much!

I am able to change mean value symbol using meanattrs=(symbol=starfilled color=black size=10px). Not sure if I could post my question here.. but is there a way display footnotes when using proc sgplot outside of the plotarea [Here are my options:]

ods graphics on / reset=index imagename='sgplot1'
width=7.25in height=6.25in;

output to ODS PDF. 

For some reason, the footnotes are displayed only inside of the plot border. Not able to display anything outside. 

Thank you. 

DanH_sas
SAS Super FREQ

Try using NOGFOOTNOTE on the ODS PDF statement. This will prevent the footnotes from  being added to the plot, but I think they might get moved to the bottom of the page. Your best option to insert text right after a graph would be to use the ODS TEXT statement. Give that a try and see if that works for you.

 

Thanks!
Dan 

smitham
Fluorite | Level 6

Hi Dan, 

I will try that.

Thank you!

smitham
Fluorite | Level 6

Hi Sanjay, 

I was finally able to use this for another plot. 

Thank you!

 

DanH_sas
SAS Super FREQ

If you want to stick with SGPLOT, consider using the INSET statement to position notes inside the graph area and the FOOTNOTE statement to move them around the outside.

 

Hope this helps!

Dan

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 8 replies
  • 2701 views
  • 1 like
  • 4 in conversation