Data visualization with SAS programming

Displaying N=xx below boxplot

Occasional Contributor
Posts: 6

Displaying N=xx below boxplot



I am producing boxplots using GTL, a boxplot statement and proc sgrender. I would like to be able to display the number of data points which contibute to each indivdual boxplot; right underneath the plot. So, for example, on one page I have 4 distinct x values, each with two boxplots (one for each value of the group variable). So all together 8 boxplots on a single page.


I have output the dataset that the boxplot statement produces and I can see that it contains the number of data points which contibute to each plot. So my question is, what is the easiest way to get this value underneath each plot? So in my example I would want 8 different N=xx values. I would also like these to be within the bound of the axis (in the wall space), so I cannot just add them in as x-axis labels.


Initial resarch pointed me towards using an annotation dataset to do this, but because these plots are to be repeated on various parameters, the positions of the annotations would have to be dynamically generated, due to the fact that not all paramaters will have the same number of plots on each page. So before I go down this road I thought I would look for suggestions on the most simple approach, as I have not used custom annotations before.


Thanks in advance

Super User
Super User
Posts: 9,227

Re: Displaying N=xx below boxplot

Get your N numers in the data, the you simply overlay a scatter plot with values as the markerchar, follow this doc:


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation