indicate_error

indicate_error(self, func, *args, medians=False, means=False, boxdata=None, bardata=None, shadedata=None, fadedata=None, boxstds=None, barstds=None, shadestds=None, fadestds=None, boxpctiles=None, barpctiles=None, shadepctiles=None, fadepctiles=None, boxmarker=True, boxmarkercolor='white', boxcolor=None, barcolor=None, shadecolor=None, fadecolor=None, shadelabel=False, fadelabel=False, shadealpha=0.4, fadealpha=0.2, boxlinewidth=None, boxlw=None, barlinewidth=None, barlw=None, capsize=None, boxzorder=2.5, barzorder=2.5, shadezorder=1.5, fadezorder=1.5, **kwargs)[source]

Adds support for drawing error bars and error shading on-the-fly. Includes options for interpreting columns of data as samples, representing the mean or median of each sample with lines, points, or bars, and drawing error bars representing percentile ranges or standard deviation multiples for each sample. Also supports specifying error bar data explicitly.

Note

This function wraps plot, scatter, bar, and violinplot

Parameters
  • *args – The input data.

  • means (bool, optional) – Whether to plot the means of each column in the input data.

  • medians (bool, optional) – Whether to plot the medians of each column in the input data.

  • barstds ((float, float) or bool, optional) – Standard deviation multiples for thin error bars with optional whiskers (i.e. caps). If True, the default standard deviation multiples (-3, 3) are used. This argument is only valid if means or medians is True.

  • barpctiles ((float, float) or bool, optional) – As with barstds, but instead using percentiles for the error bars. The percentiles are calculated with numpy.percentile. If True, the default percentiles (0, 100) are used.

  • bardata (2 x N array or 1D array, optional) – If shape is 2 x N these are the lower and upper bounds for the thin error bars. If array is 1D these are the absolute, symmetric deviations from the central points. This should be used if means and medians are both False (i.e. you did not provide dataset columns from which statistical properties can be calculated automatically).

  • boxstds, boxpctiles, boxdata (optional) – As with barstds, barpctiles, and bardata, but for thicker error bars representing a smaller interval than the thin error bars. If boxstds is True, the default standard deviation multiples (-1, 1) are used. If boxpctiles is True, the default percentile multiples (25, 75) are used (i.e. the interquartile range). When boxes and bars are combined, this has the effect of drawing miniature box-and-whisker plots.

  • shadestds, shadepctiles, shadedata (optional) – As with barstds, barpctiles, and bardata, but using shading to indicate the error range. If shadestds is True, the default standard deviation multiples (-2, 2) are used. If shadepctiles is True, the default percentile multiples (10, 90) are used. Shading is generally useful for plot plots and not bar plots.

  • fadestds, fadepctiles, fadedata (optional) – As with shadestds, shadepctiles, and shadedata, but for an additional, more faded, secondary shaded region. If fadestds is True, the default standard deviation multiples (-3, 3) are used. If fadepctiles is True, the default percentile multiples (0, 100) are used.

  • barcolor, boxcolor, shadecolor, fadecolor (color-spec, optional) – Colors for the different error indicators. For error bars, the default is 'k'. For shading, the default behavior is to inherit color from the primary Artist.

  • shadelabel, fadelabel (bool or str, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g. shadelabel=True. To apply a custom label, use e.g. shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.

  • barlinewidth, boxlinewidth, barlw, boxlw (float, optional) – Line widths for the thin and thick error bars, in points. The defaults are barlw=0.8 and boxlw=4 * barlw.

  • boxmarker (bool, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored if boxes is False. Default is True.

  • boxmarkercolor (color-spec, optional) – Color for the boxmarker marker. Default is 'w'.

  • capsize (float, optional) – The cap size for thin error bars in points.

  • barzorder, boxzorder, shadezorder, fadezorder (float, optional) – The “zorder” for the thin error bars, thick error bars, and shading.

Returns

h, err1, err2, … – The original plot object and the error bar or shading objects.