Draw a box and whisker plot. The box extends from the first quartile (Q1) to the third quartile (Q3) of the data, with a line at the median. The whiskers extend from the box to the farthest data point lying within 1.5x the inter-quartile range (IQR) from the
(self, x, notch=None, sym=None, vert=None,
orientation='vertical', whis=None, positions=None,
widths=None, patch_artist=None, bootstrap=None,
usermedians=None, conf_intervals=None,
meanline=None, showmeans=None, showcaps=None,
showbox=None, showfliers=None, boxprops=None,
tick_labels=None, flierprops=None, medianprops=None,
meanprops=None, capprops=None, whiskerprops=None,
manage_ticks=True, autorange=False, zorder=None,
capwidths=None, label=None)
| 4303 | @_api.make_keyword_only("3.10", "notch") |
| 4304 | @_preprocess_data() |
| 4305 | def boxplot(self, x, notch=None, sym=None, vert=None, |
| 4306 | orientation='vertical', whis=None, positions=None, |
| 4307 | widths=None, patch_artist=None, bootstrap=None, |
| 4308 | usermedians=None, conf_intervals=None, |
| 4309 | meanline=None, showmeans=None, showcaps=None, |
| 4310 | showbox=None, showfliers=None, boxprops=None, |
| 4311 | tick_labels=None, flierprops=None, medianprops=None, |
| 4312 | meanprops=None, capprops=None, whiskerprops=None, |
| 4313 | manage_ticks=True, autorange=False, zorder=None, |
| 4314 | capwidths=None, label=None): |
| 4315 | """ |
| 4316 | Draw a box and whisker plot. |
| 4317 | |
| 4318 | The box extends from the first quartile (Q1) to the third |
| 4319 | quartile (Q3) of the data, with a line at the median. |
| 4320 | The whiskers extend from the box to the farthest data point |
| 4321 | lying within 1.5x the inter-quartile range (IQR) from the box. |
| 4322 | Flier points are those past the end of the whiskers. |
| 4323 | See https://en.wikipedia.org/wiki/Box_plot for reference. |
| 4324 | |
| 4325 | .. code-block:: none |
| 4326 | |
| 4327 | Q1-1.5IQR Q1 median Q3 Q3+1.5IQR |
| 4328 | |-----:-----| |
| 4329 | o |--------| : |--------| o o |
| 4330 | |-----:-----| |
| 4331 | flier <-----------> fliers |
| 4332 | IQR |
| 4333 | |
| 4334 | |
| 4335 | Parameters |
| 4336 | ---------- |
| 4337 | x : 1D array or sequence of 1D arrays or 2D array |
| 4338 | The input data. Possible values: |
| 4339 | |
| 4340 | - 1D array: A single box is drawn. |
| 4341 | - sequence of 1D arrays: A box is drawn for each array in the sequence. |
| 4342 | - 2D array: A box is drawn for each column in the array. |
| 4343 | |
| 4344 | notch : bool, default: :rc:`boxplot.notch` |
| 4345 | Whether to draw a notched boxplot (`True`), or a rectangular |
| 4346 | boxplot (`False`). The notches represent the confidence interval |
| 4347 | (CI) around the median. The documentation for *bootstrap* |
| 4348 | describes how the locations of the notches are computed by |
| 4349 | default, but their locations may also be overridden by setting the |
| 4350 | *conf_intervals* parameter. |
| 4351 | |
| 4352 | .. note:: |
| 4353 | |
| 4354 | In cases where the values of the CI are less than the |
| 4355 | lower quartile or greater than the upper quartile, the |
| 4356 | notches will extend beyond the box, giving it a |
| 4357 | distinctive "flipped" appearance. This is expected |
| 4358 | behavior and consistent with other statistical |
| 4359 | visualization packages. |
| 4360 | |
| 4361 | sym : str, optional |
| 4362 | The default symbol for flier points. An empty string ('') hides |