Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

#70_Boxplot_with_Categories_on_multiple_lineThere is a tip that permits to write the category names on multiple lines. You can use it to add the number of values present in each box for example.

First change the names of your categories using the names function. Use the “\n” to write on several lines.

Then you have to increase the distance between the labels and the X axis. It avoids to have the text overlaying the axis. This is done using the mgp argument of the par function.

Mgp is a numeric vector of length 3, which sets the axis label locations relative to the edge of the inner plot window. Default value : c(3,1,0)

      – First value : location the labels (xlab and ylab in plot)

      – Second value : location of the tick-mark labels (what we want to lower)

      – Third Value : position of the tick marks


Not what you are looking for ? Make a new search !


Leave a Reply

Be the First to Comment!

Notify of