Credits Overview Plotting Styles Commands Terminals

boxplot

The set style boxplot command allows you to change the layout of plots created using the boxplot plot style.

Syntax:

      set style boxplot {range <r> | fraction <f>}
                        {{no}outliers} {pointtype <p>}
                        {candlesticks | financebars}
                        {medianlinewidth <width>}
                        {separation <x>}
                        {labels off | auto | x | x2}
                        {sorted | unsorted}

The box in the boxplot always spans the range of values from the first quartile to the third quartile of the data points. The limit of the whiskers that extend from the box can be controlled in two different ways. By default the whiskers extend from each end of the box for a range equal to 1.5 times the interquartile range (i.e. the vertical height of the box proper). Each whisker is truncated back toward the median so that it terminates at a y value belonging to some point in the data set. Since there may be no point whose value is exactly 1.5 times the interquartile distance, the whisker may be shorter than its nominal range. This default corresponds to

      set style boxplot range 1.5

Alternatively, you can specify the fraction of the total number of points that the whiskers should span. In this case the range is extended symmetrically from the median value until it encompasses the requested fraction of the data set. Here again each whisker is constrained to end at a point in the data set. To span 95% of the points in the set

      set style boxplot fraction 0.95

Any points that lie outside the range of the whiskers are considered outliers. By default these are drawn as individual circles (pointtype 7). The option nooutliers disables this. If outliers are not drawn they do not contribute to autoscaling.

By default boxplots are drawn in a style similar to candlesticks, but you have the option of using instead a style similar to finance bars.

A crossbar indicating the median is drawn using the same line type as box boundary. If you want a thicker line for the median

      set style boxplot medianlinewidth 2.0

If you want no median line, set this to 0.

If the using specification for a boxplot contains a fourth column, the values in that column will be interpreted as a discrete category to which this data point belongs. In this case one boxplot is drawn for each category found in the input. These boxplots will be drawn next to each other spaced by 1.0 along x (in x-axis units). This spacing can be changed by the option set style boxplot separation.

The labels option governs how and where these boxplots (each representing a part of the dataset) are labeled. By default the category identifier is used as a tick label on the horizontal axis -- x or x2, depending on which one is used for the plot itself. This setting corresponds to option labels auto. The labels can be forced to use either of the x or x2 axes -- options labels x and labels x2, respectively --, or they can be turned off altogether with the option labels off.

By default the boxplots corresponding to different categories will be drawn in the same order the levels are encountered in the data file. This behavior corresponds to the unsorted option. If the sorted option is active, the category identifiers are first sorted alphabetically, and the boxplots are drawn in the sorted order.

The separation, labels, sorted and unsorted option only have an effect if a fourth column is given the plot specification.

See boxplot, candlesticks, financebars.