.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plots/boxplot.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plots_boxplot.py: .. _exa-boxplot: Boxplot ======= Much of the functionality is shared with :class:`plot.Barplot`. .. GENERATED FROM PYTHON SOURCE LINES 23-25 .. code-block:: Python from eelbrain import * .. GENERATED FROM PYTHON SOURCE LINES 26-28 Basic boxplot ^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 28-33 .. code-block:: Python ds = datasets.get_uv() ds.summary() p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds) .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_001.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 34-38 Test against population mean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Instead of pairwise tests, test the values in each category against a population mean. Use the ``test`` parameter to set the value to test against. In the example, ``test=0`` will test whether each sample is significantly different form zero. Use the ``tail`` parameter to determine the tailedness of the test (``tail=1`` to test for a value greater than 0). .. GENERATED FROM PYTHON SOURCE LINES 38-41 .. code-block:: Python p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds, test=0, tail=1) .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_002.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 42-44 Appearance: colored boxes and category labels ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 44-75 .. code-block:: Python colors = { ('a1', 'b1'): (1.0, 0.0, 0.0), ('a1', 'b2'): (1.0, 0.7, 0.0), ('a2', 'b1'): (0.0, 0.0, 1.0), ('a2', 'b2'): (0.0, 0.8, 1.0), } labels = { ('a1', 'b1'): 'A-1 (B-1)', ('a1', 'b2'): 'A-1 (B-2)', ('a2', 'b1'): 'A-2 (B-1)', ('a2', 'b2'): 'A-2 (B-2)', } p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds, colors=colors, xticks=labels) colors = { ('a1', 'b1'): plot.Style((1, .5, .5), hatch=''), ('a1', 'b2'): plot.Style((1, .5, .5), hatch='///'), ('a2', 'b1'): plot.Style((.5, .5, 1), hatch=''), ('a2', 'b2'): plot.Style((.5, .5, 1), hatch='///'), } p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds, colors=colors) colors = { ('a1', 'b1'): plot.Style('w', hatch='///'), ('a1', 'b2'): plot.Style('w', hatch='/'), ('a2', 'b1'): plot.Style('w', hatch='O'), ('a2', 'b2'): plot.Style('w', hatch='.'), } p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds, colors=colors) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_003.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_004.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_005.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_005.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 76-80 Label fliers ^^^^^^^^^^^^ The ``label_fliers=True`` option is used to identify outlier points (labels are based on the ``match`` argument). .. GENERATED FROM PYTHON SOURCE LINES 80-82 .. code-block:: Python p = plot.Boxplot('fltvar', 'A % B', match='rm', data=ds, label_fliers=True) .. image-sg:: /auto_examples/plots/images/sphx_glr_boxplot_006.png :alt: boxplot :srcset: /auto_examples/plots/images/sphx_glr_boxplot_006.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_examples_plots_boxplot.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: boxplot.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: boxplot.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: boxplot.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_