Those letters are called "compact letter display", which may help on any internet searches. 
I have used package emmeans for doing post-hoc tests and calculating compact letter display via the cld() function. I've then taken those results and added them to plots. I'm sure other packages can create the compact letter display, as well; it may depend on what type model you fit and what package you used for the post-hoc tests.
As an aside, I am definitely pro-boxplot but when I am showing results from a statistical analysis involving means I add the means to the plot in addition to the median line so the analysis and results "match" better.