# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

from __future__ import absolute_import, division, print_function

from unittest import TestCase, main

import numpy as np
import numpy.testing as npt
import matplotlib.pyplot as plt

from skbio.draw import boxplots, grouped_distributions
from skbio.draw._distributions import (
    _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot,
    _create_legend, _get_distribution_markers, _is_single_matplotlib_color,
    _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options,
    _set_figure_size, _validate_input, _validate_x_values)


class DistributionsTests(TestCase):
    def setUp(self):
        # Test null data list.
        self.Null = None

        # Test empty data list.
        self.Empty = []

        # Test nested empty data list.
        self.EmptyNested = [[]]

        # Test nested empty data list (for bar/scatter plots).
        self.EmptyDeeplyNested = [[[]]]

        # Test invalid number of samples in data list (for bar/scatter plots).
        self.InvalidNumSamples = [[[1, 2, 3, 4, 5]],
                                  [[4, 5, 6, 7, 8], [2, 3, 2]],
                                  [[4, 7, 10, 33, 32, 6, 7, 8]]]

        # Test valid data with three samples and four data points
        # (for bar/scatter plots).
        self.ValidTypicalData = [[[1.0, 2, 3.5, 5], [2, 3, 5, 6], [2, 3, 8]],
                                 [[4, 7, 8], [8, 9, 10, 11], [9.0, 4, 1, 1]],
                                 [[4, 33, 32, 6, 8], [5, 4, 8, 13], [1, 1, 2]],
                                 [[2, 2, 2, 2], [3, 9, 8], [2, 1, 6, 7, 4, 5]]]

        # Test valid data with one sample (for bar/scatter plots).
        self.ValidSingleSampleData = [[[1, 2, 3, 4, 5]],
                                      [[4, 5, 6, 7, 8]],
                                      [[4, 7, 10, 33, 32, 6, 7, 8]]]

        # Test typical data to be plotted by the boxplot function.
        self.ValidTypicalBoxData = [[3.4, 10, 11.67, 12.0, 2, 2, 99.99],
                                    [2.3, 4, 5, 88, 9, 10, 11, 1, 0, 3, -8],
                                    [2, 9, 7, 5, 6]]

    def tearDown(self):
        # We get a warning from mpl if we don't clean up our figures.
        plt.close('all')

    def test_validate_input_null(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.Null, None, None, None)

    def test_validate_input_empty(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.Empty, None, None, None)

    def test_validate_input_empty_nested(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.EmptyNested, None, None, None)

    def test_validate_input_empty_deeply_nested(self):
        num_points, num_samples = _validate_input(self.EmptyDeeplyNested,
                                                  None, None, None)
        self.assertEqual(num_points, 1)
        self.assertEqual(num_samples, 1)

    def test_validate_input_empty_point(self):
        with npt.assert_raises(ValueError):
            _validate_input([[[1, 2, 3], [4, 5]], []], None, None, None)

    def test_validate_input_invalid_num_samples(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.InvalidNumSamples, None, None, None)

    def test_validate_input_invalid_data_point_names(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.ValidSingleSampleData, None, ["T0", "T1"],
                            None)

    def test_validate_input_invalid_sample_names(self):
        with npt.assert_raises(ValueError):
            _validate_input(self.ValidSingleSampleData, None, None,
                            ["Men", "Women"])

    def test_validate_input_all_valid_input(self):
        self.assertEqual(_validate_input(self.ValidTypicalData, [1, 3, 4, 8],
                                         ["T0", "T1", "T2", "T3"],
                                         ["Infants", "Children", "Teens"]),
                         (4, 3))

    def test_validate_x_values_invalid_x_values(self):
        with npt.assert_raises(ValueError):
            _validate_x_values([1, 2, 3, 4], ["T0", "T1", "T2"],
                               len(self.ValidSingleSampleData))

    def test_validate_x_values_invalid_x_tick_labels(self):
        with npt.assert_raises(ValueError):
            _validate_x_values(None, ["T0"], len(self.ValidSingleSampleData))

    def test_validate_x_values_nonnumber_x_values(self):
        with npt.assert_raises(ValueError):
            _validate_x_values(["foo", 2, 3], None,
                               len(self.ValidSingleSampleData))

    def test_validate_x_values_valid_x_values(self):
        _validate_x_values([1, 2.0, 3], None, 3)

    def test_get_distribution_markers_null_marker_list(self):
        self.assertEqual(_get_distribution_markers('colors', None, 5),
                         ['b', 'g', 'r', 'c', 'm'])

    def test_get_distribution_markers_empty_marker_list(self):
        self.assertEqual(_get_distribution_markers('colors', None, 4),
                         ['b', 'g', 'r', 'c'])

    def test_get_distribution_markers_insufficient_markers(self):
        self.assertEqual(npt.assert_warns(RuntimeWarning,
                                          _get_distribution_markers,
                                          'colors', None, 10),
                         ['b', 'g', 'r', 'c', 'm', 'y', 'w', 'b', 'g', 'r'])
        self.assertEqual(npt.assert_warns(RuntimeWarning,
                                          _get_distribution_markers,
                                          'symbols', ['^', '>', '<'], 5),
                         ['^', '>', '<', '^', '>'])

    def test_get_distribution_markers_bad_marker_type(self):
        with npt.assert_raises(ValueError):
            _get_distribution_markers('shapes', [], 3)

    def test_get_distribution_markers_zero_markers(self):
        self.assertEqual(_get_distribution_markers('symbols', None, 0), [])
        self.assertEqual(_get_distribution_markers('symbols', ['^'], 0), [])

    def test_get_distribution_markers_negative_num_markers(self):
        with npt.assert_raises(ValueError):
            _get_distribution_markers('symbols', [], -1)

    def test_plot_bar_data(self):
        fig, ax = plt.subplots()
        result = _plot_bar_data(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'stdv')
        self.assertEqual(result[0].__class__.__name__, "Rectangle")
        self.assertEqual(len(result), 1)
        self.assertAlmostEqual(result[0].get_width(), 0.5)
        self.assertAlmostEqual(result[0].get_facecolor(), (1.0, 0.0, 0.0, 1.0))
        self.assertAlmostEqual(result[0].get_height(), 2.0)

        fig, ax = plt.subplots()
        result = _plot_bar_data(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'sem')
        self.assertEqual(result[0].__class__.__name__, "Rectangle")
        self.assertEqual(len(result), 1)
        self.assertAlmostEqual(result[0].get_width(), 0.5)
        self.assertAlmostEqual(result[0].get_facecolor(), (1.0, 0.0, 0.0, 1.0))
        self.assertAlmostEqual(result[0].get_height(), 2.0)

    def test_plot_bar_data_bad_error_bar_type(self):
        fig, ax = plt.subplots()
        with npt.assert_raises(ValueError):
            _plot_bar_data(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'var')

    def test_plot_bar_data_empty(self):
        fig, ax = plt.subplots()
        result = _plot_bar_data(ax, [], 'red', 0.5, 3.75, 1.5, 'stdv')
        self.assertTrue(result is None)

        fig, ax = plt.subplots()
        result = _plot_bar_data(ax, [], 'red', 0.5, 3.75, 1.5, 'sem')
        self.assertTrue(result is None)

    def test_plot_scatter_data(self):
        fig, ax = plt.subplots()
        result = _plot_scatter_data(ax, [1, 2, 3], '^', 0.77, 1, 1.5, 'stdv')
        self.assertEqual(result.get_sizes(), 20)

    def test_plot_scatter_data_empty(self):
        fig, ax = plt.subplots()
        result = _plot_scatter_data(ax, [], '^', 0.77, 1, 1.5, 'stdv')
        self.assertTrue(result is None)

    def test_plot_box_data(self):
        fig, ax = plt.subplots()
        result = _plot_box_data(ax, [0, 0, 7, 8, -3, 44], 'blue', 0.33, 55,
                                1.5, 'stdv')
        self.assertEqual(result.__class__.__name__, "dict")
        self.assertEqual(len(result['boxes']), 1)
        self.assertEqual(len(result['medians']), 1)
        self.assertEqual(len(result['whiskers']), 2)

        # mpl < 1.4.0 creates two Line2D instances, mpl 1.4.0 creates one,
        # though the resulting plot looks identical between the two versions.
        # see:
        #   https://github.com/pydata/pandas/issues/8382#issuecomment-56840974
        #   https://github.com/matplotlib/matplotlib/issues/3544
        self.assertTrue(len(result['fliers']) == 1 or
                        len(result['fliers']) == 2)

        self.assertEqual(len(result['caps']), 2)

    def test_plot_box_data_empty(self):
        fig, ax = plt.subplots()
        result = _plot_box_data(ax, [], 'blue', 0.33, 55, 1.5, 'stdv')
        self.assertTrue(result is None)

    def test_calc_data_point_locations_invalid_x_values(self):
        with npt.assert_raises(ValueError):
            _calc_data_point_locations(3, [1, 10.5])

    def test_calc_data_point_locations_default_spacing(self):
        locs = _calc_data_point_locations(4)
        np.testing.assert_allclose(locs, [1, 2, 3, 4])

    def test_calc_data_point_locations_custom_spacing(self):
        # Scaling down from 3..12 to 1..4.
        locs = _calc_data_point_locations(4, [3, 4, 10, 12])
        np.testing.assert_allclose(locs,
                                   np.array([1, 1.33333333, 3.33333333, 4]))

        # Sorted order shouldn't affect scaling.
        locs = _calc_data_point_locations(4, [4, 3, 12, 10])
        np.testing.assert_allclose(locs,
                                   np.array([1.33333333, 1, 4, 3.33333333]))

        # Scaling up from 0.001..0.87 to 1..3.
        locs = _calc_data_point_locations(3, [0.001, 0.2543, 0.87])
        np.testing.assert_allclose(locs,
                                   np.array([1, 1.58296893, 3]))

    def test_calc_data_point_ticks(self):
        ticks = _calc_data_point_ticks(np.array([1, 5, 9, 11]), 1, 0.5, False)
        np.testing.assert_allclose(ticks, [1.25, 5.25, 9.25, 11.25])

        ticks = _calc_data_point_ticks(np.array([0]), 3, 0.5, False)
        np.testing.assert_allclose(ticks, [0.75])

    def test_set_axes_options(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, "Plot Title", "x-axis label", "y-axis label",
                          x_tick_labels=["T0", "T1"])
        self.assertEqual(ax.get_title(), "Plot Title")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(ax.get_xticklabels()[0].get_text(), "T0")
        self.assertEqual(ax.get_xticklabels()[1].get_text(), "T1")

    def test_set_axes_options_ylim(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, "Plot Title", "x-axis label", "y-axis label",
                          x_tick_labels=["T0", "T1", "T2"], y_min=0, y_max=1)
        self.assertEqual(ax.get_title(), "Plot Title")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(ax.get_xticklabels()[0].get_text(), "T0")
        self.assertEqual(ax.get_xticklabels()[1].get_text(), "T1")
        self.assertEqual(ax.get_ylim(), (0.0, 1.0))

    def test_set_axes_options_x_values_as_tick_labels(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, "Plot Title", "x-axis label", "y-axis label",
                          x_values=[42, 45, 800])

        self.assertEqual(ax.get_title(), "Plot Title")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(ax.get_xticklabels()[0].get_text(), '42')
        self.assertEqual(ax.get_xticklabels()[1].get_text(), '45')
        self.assertEqual(ax.get_xticklabels()[2].get_text(), '800')

    def test_set_axes_options_bad_ylim(self):
        fig, ax = plt.subplots()
        with npt.assert_raises(ValueError):
            _set_axes_options(ax, "Plot Title", "x-axis label", "y-axis label",
                              x_tick_labels=["T0", "T1", "T2"], y_min='car',
                              y_max=30)

    def test_set_axes_options_invalid_x_tick_labels_orientation(self):
        fig, ax = plt.subplots()
        with npt.assert_raises(ValueError):
            _set_axes_options(ax, "Plot Title", "x-axis label", "y-axis label",
                              x_tick_labels=["T0", "T1"],
                              x_tick_labels_orientation='brofist')

    def test_create_legend(self):
        fig, ax = plt.subplots()
        _create_legend(ax, ['b', 'r'], ['dist1', 'dist2'], 'colors')
        self.assertEqual(len(ax.get_legend().get_texts()), 2)

        fig, ax = plt.subplots()
        _create_legend(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'],
                       'symbols')
        self.assertEqual(len(ax.get_legend().get_texts()), 3)

    def test_create_legend_invalid_input(self):
        fig, ax = plt.subplots()
        with npt.assert_raises(ValueError):
            _create_legend(ax, ['^', '<', '>'], ['dist1', 'dist2'], 'symbols')
        with npt.assert_raises(ValueError):
            _create_legend(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'],
                           'foo')

    def test_grouped_distributions_bar(self):
        fig = grouped_distributions('bar', self.ValidTypicalData,
                                    [1, 4, 10, 11], ["T0", "T1", "T2", "T3"],
                                    ["Infants", "Children", "Teens"],
                                    ['b', 'r', 'g'], "x-axis label",
                                    "y-axis label", "Test")
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 4)
        np.testing.assert_allclose(ax.get_xticks(),
                                   [1.1125, 2.0125, 3.8125, 4.1125])

    def test_grouped_distributions_insufficient_colors(self):
        args = ('bar', self.ValidTypicalData, [1, 4, 10, 11],
                ["T0", "T1", "T2", "T3"], ["Infants", "Children", "Teens"],
                ['b', 'r'], "x-axis label", "y-axis label", "Test")

        npt.assert_warns(RuntimeWarning,
                         grouped_distributions,
                         *args)

    def test_grouped_distributions_scatter(self):
        fig = grouped_distributions('scatter', self.ValidTypicalData,
                                    [1, 4, 10, 11], ["T0", "T1", "T2", "T3"],
                                    ["Infants", "Children", "Teens"],
                                    ['^', '>', '<'], "x-axis label",
                                    "y-axis label", "Test")
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 4)
        np.testing.assert_allclose(ax.get_xticks(),
                                   [1.075, 1.975, 3.775, 4.075])

    def test_grouped_distributions_insufficient_symbols(self):
        args = ('scatter', self.ValidTypicalData, [1, 4, 10, 11],
                ["T0", "T1", "T2", "T3"], ["Infants", "Children", "Teens"],
                ['^'], "x-axis label", "y-axis label", "Test")

        npt.assert_warns(RuntimeWarning, grouped_distributions, *args)

    def test_grouped_distributions_empty_marker_list(self):
        grouped_distributions('scatter', self.ValidTypicalData,
                              [1, 4, 10, 11], ["T0", "T1", "T2", "T3"],
                              ["Infants", "Children", "Teens"], [],
                              "x-axis label", "y-axis label", "Test")

    def test_grouped_distributions_box(self):
        fig = grouped_distributions('box', self.ValidTypicalData,
                                    [1, 4, 10, 11], ["T0", "T1", "T2", "T3"],
                                    ["Infants", "Children", "Teens"],
                                    ['b', 'g', 'y'], "x-axis label",
                                    "y-axis label", "Test")
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 4)
        np.testing.assert_allclose(ax.get_xticks(),
                                   [1.075, 1.975, 3.775, 4.075])

    def test_grouped_distributions_error(self):
        with npt.assert_raises(ValueError):
            grouped_distributions('pie', self.ValidTypicalData,
                                  [1, 4, 10, 11], ["T0", "T1", "T2", "T3"],
                                  ["Infants", "Children", "Teens"],
                                  ['b', 'g', 'y'],
                                  "x-axis label", "y-axis label", "Test")

    def test_grouped_distributions_negative_distribution_width(self):
        args = ('box', self.ValidTypicalData, [1, 4, 10, 11],
                ["T0", "T1", "T2", "T3"], ["Infants", "Children", "Teens"],
                ['b', 'g', 'y'], "x-axis label", "y-axis label", "Test")

        with self.assertRaises(ValueError):
            grouped_distributions(*args, distribution_width=0)

        with self.assertRaises(ValueError):
            grouped_distributions(*args, distribution_width=-42)

    def test_boxplots(self):
        fig = boxplots(self.ValidTypicalBoxData, [1, 4, 10],
                       ["Data 1", "Data 2", "Data 3"], "Test", "x-axis label",
                       "y-axis label",
                       legend=(('blue', 'red'), ('foo', 'bar')))
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 3)
        self.assertTrue(np.array_equal(ax.get_xticks(), [1, 4, 10]))

    def test_boxplots_empty_distributions(self):
        fig = boxplots([[1, 2, 3], [], [4, 5, 6]], [1, 4, 10],
                       ["Data 1", "Data 2", "Data 3"], "Test", "x-axis label",
                       "y-axis label")
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 3)
        self.assertTrue(np.array_equal(ax.get_xticks(), [1, 4, 10]))

        # second distribution (empty) should have nans since it is hidden.
        # boxplots in mpl < 1.4.0 have 8 lines per boxplot, while mpl 1.4.0 has
        # 7. in either case, the line at index 8 should have a nan for its y
        # value
        lines = ax.get_lines()
        self.assertTrue(np.isnan(lines[8].get_xydata()[0][1]))
        # line in first distribution should *not* have nan for its y value
        self.assertFalse(np.isnan(lines[0].get_xydata()[0][1]))

        # All distributions are empty.
        fig = boxplots([[], [], []], [1, 4, 10],
                       ["Data 1", "Data 2", "Data 3"], "Test", "x-axis label",
                       "y-axis label")
        ax = fig.get_axes()[0]
        self.assertEqual(ax.get_title(), "Test")
        self.assertEqual(ax.get_xlabel(), "x-axis label")
        self.assertEqual(ax.get_ylabel(), "y-axis label")
        self.assertEqual(len(ax.get_xticklabels()), 3)
        self.assertTrue(np.array_equal(ax.get_xticks(), [1, 4, 10]))

        lines = ax.get_lines()
        self.assertTrue(np.isnan(lines[0].get_xydata()[0][1]))
        self.assertTrue(np.isnan(lines[8].get_xydata()[0][1]))
        self.assertTrue(np.isnan(lines[16].get_xydata()[0][1]))

    def test_boxplots_box_colors(self):
        # Coloring works with all empty distributions.
        fig = boxplots([[], [], []], box_colors=['blue', 'red', 'yellow'])
        ax = fig.get_axes()[0]
        self.assertEqual(len(ax.get_xticklabels()), 3)
        # patch colors should match what we specified
        self.assertEqual(ax.patches[0].get_facecolor(), (0.0, 0.0, 1.0, 1.0))
        self.assertEqual(ax.patches[1].get_facecolor(), (1.0, 0.0, 0.0, 1.0))
        self.assertEqual(ax.patches[2].get_facecolor(), (1.0, 1.0, 0.0, 1.0))
        # patch location should include at least one nan since the distribution
        # is empty, and thus hidden
        for patch in ax.patches:
            self.assertTrue(np.isnan(patch.xy[0][1]))

        fig = boxplots([[], [], []], box_colors='pink')
        ax = fig.get_axes()[0]
        self.assertEqual(len(ax.get_xticklabels()), 3)
        for patch in ax.patches:
            npt.assert_almost_equal(
                patch.get_facecolor(),
                (1.0, 0.7529411764705882, 0.796078431372549, 1.0))
            self.assertTrue(np.isnan(patch.xy[0][1]))

        # Coloring works with some empty distributions.
        fig = boxplots([[], [1, 2, 3.5], []],
                       box_colors=['blue', 'red', 'yellow'])
        ax = fig.get_axes()[0]
        self.assertEqual(len(ax.get_xticklabels()), 3)
        self.assertEqual(ax.patches[0].get_facecolor(), (0.0, 0.0, 1.0, 1.0))
        self.assertEqual(ax.patches[1].get_facecolor(), (1.0, 0.0, 0.0, 1.0))
        self.assertEqual(ax.patches[2].get_facecolor(), (1.0, 1.0, 0.0, 1.0))
        self.assertTrue(np.isnan(ax.patches[0].xy[0][1]))
        self.assertFalse(np.isnan(ax.patches[1].xy[0][1]))
        self.assertTrue(np.isnan(ax.patches[2].xy[0][1]))

    def test_boxplots_invalid_input(self):
        # Non-numeric entries in distribution.
        with npt.assert_raises(ValueError):
            boxplots([[1, 'foo', 3]])

        # Number of colors doesn't match number of distributions.
        with npt.assert_raises(ValueError):
            boxplots([[1, 2, 3], [], [4, 5, 6]], box_colors=['blue', 'red'])

        # Invalid legend.
        with npt.assert_raises(ValueError):
            boxplots([[1, 2, 3]], legend=('foo', 'bar', 'baz'))

    def test_color_box_plot(self):
        fig, ax = plt.subplots()
        box_plot = plt.boxplot(self.ValidTypicalBoxData)
        _color_box_plot(ax, box_plot, ['blue', 'w', (1, 1, 0.9)])

        # Some colors are None.
        fig, ax = plt.subplots()
        box_plot = plt.boxplot(self.ValidTypicalBoxData)
        _color_box_plot(ax, box_plot, ['blue', None, (1, 1, 0.9)])

        # All colors are None.
        fig, ax = plt.subplots()
        box_plot = plt.boxplot(self.ValidTypicalBoxData)
        _color_box_plot(ax, box_plot, [None, None, None])

    def test_color_box_plot_invalid_input(self):
        # Invalid color.
        fig, ax = plt.subplots()
        box_plot = plt.boxplot(self.ValidTypicalBoxData)
        with npt.assert_raises(ValueError):
            _color_box_plot(ax, box_plot, ['red', 'foobarbaz', 'blue'])

        # Wrong number of colors.
        fig, ax = plt.subplots()
        box_plot = plt.boxplot(self.ValidTypicalBoxData)
        with npt.assert_raises(ValueError):
            _color_box_plot(ax, box_plot, ['blue', (1, 1, 0.9)])

    def test_is_single_matplotlib_color(self):
        self.assertTrue(_is_single_matplotlib_color('w'))
        self.assertTrue(_is_single_matplotlib_color('white'))
        self.assertTrue(_is_single_matplotlib_color([1, 1, 1]))
        self.assertTrue(_is_single_matplotlib_color([1, 1, 1, 1]))
        self.assertTrue(_is_single_matplotlib_color((1, 1, 1)))
        self.assertTrue(_is_single_matplotlib_color((1, 1, 1, 1)))
        self.assertTrue(_is_single_matplotlib_color((1.0, 1.0, 1.0, 1.0)))
        self.assertTrue(_is_single_matplotlib_color((1.0, 1, 1.0)))
        self.assertTrue(_is_single_matplotlib_color((2.0, 1, 1.0)))

        self.assertFalse(_is_single_matplotlib_color(['w', 'r']))
        self.assertFalse(_is_single_matplotlib_color(['w']))
        self.assertFalse(_is_single_matplotlib_color(('w',)))
        self.assertFalse(_is_single_matplotlib_color(((1.0, 1.0, 1),)))
        self.assertFalse(_is_single_matplotlib_color(((1.0, 1.0, 1),
                                                      (0.9, 0.9))))

    def test_set_figure_size(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                          x_tick_labels=['foofoofoo', 'barbarbar'],
                          x_tick_labels_orientation='vertical')
        _set_figure_size(fig, 3, 4)
        self.assertTrue(np.array_equal(fig.get_size_inches(), (3, 4)))

    def test_set_figure_size_defaults(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                          x_tick_labels=['foofoofoo', 'barbarbar'],
                          x_tick_labels_orientation='vertical')
        orig_fig_size = fig.get_size_inches()
        _set_figure_size(fig)
        self.assertTrue(np.array_equal(fig.get_size_inches(), orig_fig_size))

    def test_set_figure_size_invalid(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                          x_tick_labels=['foofoofoo', 'barbarbar'],
                          x_tick_labels_orientation='vertical')
        orig_fig_size = fig.get_size_inches()
        _set_figure_size(fig, -1, 0)
        self.assertTrue(np.array_equal(fig.get_size_inches(), orig_fig_size))

    def test_set_figure_size_long_labels(self):
        fig, ax = plt.subplots()
        _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                          x_tick_labels=['foofoofooooooooooooooooooooooooo'
                                         'oooooooooooooooooooooooooooooooo'
                                         'oooooooooooooooooooooooooooooooo'
                                         'oooo', 'barbarbar'],
                          x_tick_labels_orientation='vertical')
        npt.assert_warns(RuntimeWarning, _set_figure_size, fig, 3, 3)
        npt.assert_array_equal(fig.get_size_inches(), (3, 3))


if __name__ == '__main__':
    main()

[((26694, 26700), 'unittest.main', 'main', ([], {}), '()\n', (26698, 26700), False, 'from unittest import TestCase, main\n'), ((2568, 2584), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (2577, 2584), True, 'import matplotlib.pyplot as plt\n'), ((3118, 3175), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.EmptyDeeplyNested', 'None', 'None', 'None'], {}), '(self.EmptyDeeplyNested, None, None, None)\n', (3133, 3175), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((5070, 5110), 'skbio.draw._distributions._validate_x_values', '_validate_x_values', (['[1, 2.0, 3]', 'None', '(3)'], {}), '([1, 2.0, 3], None, 3)\n', (5088, 5110), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((6660, 6674), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (6672, 6674), True, 'import matplotlib.pyplot as plt\n'), ((6692, 6752), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', (['ax', '[1, 2, 3]', '"""red"""', '(0.5)', '(3.75)', '(1.5)', '"""stdv"""'], {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'stdv')\n", (6706, 6752), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((7080, 7094), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7092, 7094), True, 'import matplotlib.pyplot as plt\n'), ((7112, 7171), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', (['ax', '[1, 2, 3]', '"""red"""', '(0.5)', '(3.75)', '(1.5)', '"""sem"""'], {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'sem')\n", (7126, 7171), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((7552, 7566), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7564, 7566), True, 'import matplotlib.pyplot as plt\n'), ((7742, 7756), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7754, 7756), True, 'import matplotlib.pyplot as plt\n'), ((7774, 7827), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', (['ax', '[]', '"""red"""', '(0.5)', '(3.75)', '(1.5)', '"""stdv"""'], {}), "(ax, [], 'red', 0.5, 3.75, 1.5, 'stdv')\n", (7788, 7827), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((7887, 7901), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7899, 7901), True, 'import matplotlib.pyplot as plt\n'), ((7919, 7971), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', (['ax', '[]', '"""red"""', '(0.5)', '(3.75)', '(1.5)', '"""sem"""'], {}), "(ax, [], 'red', 0.5, 3.75, 1.5, 'sem')\n", (7933, 7971), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((8069, 8083), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (8081, 8083), True, 'import matplotlib.pyplot as plt\n'), ((8101, 8161), 'skbio.draw._distributions._plot_scatter_data', '_plot_scatter_data', (['ax', '[1, 2, 3]', '"""^"""', '(0.77)', '(1)', '(1.5)', '"""stdv"""'], {}), "(ax, [1, 2, 3], '^', 0.77, 1, 1.5, 'stdv')\n", (8119, 8161), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((8274, 8288), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (8286, 8288), True, 'import matplotlib.pyplot as plt\n'), ((8306, 8359), 'skbio.draw._distributions._plot_scatter_data', '_plot_scatter_data', (['ax', '[]', '"""^"""', '(0.77)', '(1)', '(1.5)', '"""stdv"""'], {}), "(ax, [], '^', 0.77, 1, 1.5, 'stdv')\n", (8324, 8359), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((8453, 8467), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (8465, 8467), True, 'import matplotlib.pyplot as plt\n'), ((8485, 8556), 'skbio.draw._distributions._plot_box_data', '_plot_box_data', (['ax', '[0, 0, 7, 8, -3, 44]', '"""blue"""', '(0.33)', '(55)', '(1.5)', '"""stdv"""'], {}), "(ax, [0, 0, 7, 8, -3, 44], 'blue', 0.33, 55, 1.5, 'stdv')\n", (8499, 8556), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((9332, 9346), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (9344, 9346), True, 'import matplotlib.pyplot as plt\n'), ((9364, 9417), 'skbio.draw._distributions._plot_box_data', '_plot_box_data', (['ax', '[]', '"""blue"""', '(0.33)', '(55)', '(1.5)', '"""stdv"""'], {}), "(ax, [], 'blue', 0.33, 55, 1.5, 'stdv')\n", (9378, 9417), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((9697, 9726), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', (['(4)'], {}), '(4)\n', (9723, 9726), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((9735, 9781), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['locs', '[1, 2, 3, 4]'], {}), '(locs, [1, 2, 3, 4])\n', (9761, 9781), True, 'import numpy as np\n'), ((9902, 9947), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', (['(4)', '[3, 4, 10, 12]'], {}), '(4, [3, 4, 10, 12])\n', (9928, 9947), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((10131, 10176), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', (['(4)', '[4, 3, 12, 10]'], {}), '(4, [4, 3, 12, 10])\n', (10157, 10176), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((10358, 10410), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', (['(3)', '[0.001, 0.2543, 0.87]'], {}), '(3, [0.001, 0.2543, 0.87])\n', (10384, 10410), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((10647, 10707), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['ticks', '[1.25, 5.25, 9.25, 11.25]'], {}), '(ticks, [1.25, 5.25, 9.25, 11.25])\n', (10673, 10707), True, 'import numpy as np\n'), ((10786, 10827), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['ticks', '[0.75]'], {}), '(ticks, [0.75])\n', (10812, 10827), True, 'import numpy as np\n'), ((10884, 10898), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (10896, 10898), True, 'import matplotlib.pyplot as plt\n'), ((10907, 11006), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""Plot Title"""', '"""x-axis label"""', '"""y-axis label"""'], {'x_tick_labels': "['T0', 'T1']"}), "(ax, 'Plot Title', 'x-axis label', 'y-axis label',\n    x_tick_labels=['T0', 'T1'])\n", (10924, 11006), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((11337, 11351), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (11349, 11351), True, 'import matplotlib.pyplot as plt\n'), ((11360, 11483), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""Plot Title"""', '"""x-axis label"""', '"""y-axis label"""'], {'x_tick_labels': "['T0', 'T1', 'T2']", 'y_min': '(0)', 'y_max': '(1)'}), "(ax, 'Plot Title', 'x-axis label', 'y-axis label',\n    x_tick_labels=['T0', 'T1', 'T2'], y_min=0, y_max=1)\n", (11377, 11483), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((11885, 11899), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (11897, 11899), True, 'import matplotlib.pyplot as plt\n'), ((11908, 12003), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""Plot Title"""', '"""x-axis label"""', '"""y-axis label"""'], {'x_values': '[42, 45, 800]'}), "(ax, 'Plot Title', 'x-axis label', 'y-axis label',\n    x_values=[42, 45, 800])\n", (11925, 12003), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((12407, 12421), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (12419, 12421), True, 'import matplotlib.pyplot as plt\n'), ((12753, 12767), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (12765, 12767), True, 'import matplotlib.pyplot as plt\n'), ((13070, 13084), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (13082, 13084), True, 'import matplotlib.pyplot as plt\n'), ((13093, 13153), 'skbio.draw._distributions._create_legend', '_create_legend', (['ax', "['b', 'r']", "['dist1', 'dist2']", '"""colors"""'], {}), "(ax, ['b', 'r'], ['dist1', 'dist2'], 'colors')\n", (13107, 13153), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((13235, 13249), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (13247, 13249), True, 'import matplotlib.pyplot as plt\n'), ((13258, 13333), 'skbio.draw._distributions._create_legend', '_create_legend', (['ax', "['^', '<', '>']", "['dist1', 'dist2', 'dist3']", '"""symbols"""'], {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'], 'symbols')\n", (13272, 13333), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((13486, 13500), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (13498, 13500), True, 'import matplotlib.pyplot as plt\n'), ((13840, 14032), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['"""bar"""', 'self.ValidTypicalData', '[1, 4, 10, 11]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']", "['b', 'r', 'g']", '"""x-axis label"""', '"""y-axis label"""', '"""Test"""'], {}), "('bar', self.ValidTypicalData, [1, 4, 10, 11], ['T0',\n    'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], ['b', 'r', 'g'],\n    'x-axis label', 'y-axis label', 'Test')\n", (13861, 14032), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((14819, 14881), 'numpy.testing.assert_warns', 'npt.assert_warns', (['RuntimeWarning', 'grouped_distributions', '*args'], {}), '(RuntimeWarning, grouped_distributions, *args)\n', (14835, 14881), True, 'import numpy.testing as npt\n'), ((14997, 15194), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['"""scatter"""', 'self.ValidTypicalData', '[1, 4, 10, 11]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']", "['^', '>', '<']", '"""x-axis label"""', '"""y-axis label"""', '"""Test"""'], {}), "('scatter', self.ValidTypicalData, [1, 4, 10, 11], [\n    'T0', 'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], ['^', '>',\n    '<'], 'x-axis label', 'y-axis label', 'Test')\n", (15018, 15194), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((15976, 16038), 'numpy.testing.assert_warns', 'npt.assert_warns', (['RuntimeWarning', 'grouped_distributions', '*args'], {}), '(RuntimeWarning, grouped_distributions, *args)\n', (15992, 16038), True, 'import numpy.testing as npt\n'), ((16108, 16292), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['"""scatter"""', 'self.ValidTypicalData', '[1, 4, 10, 11]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']", '[]', '"""x-axis label"""', '"""y-axis label"""', '"""Test"""'], {}), "('scatter', self.ValidTypicalData, [1, 4, 10, 11], [\n    'T0', 'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], [],\n    'x-axis label', 'y-axis label', 'Test')\n", (16129, 16292), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((16435, 16627), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['"""box"""', 'self.ValidTypicalData', '[1, 4, 10, 11]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']", "['b', 'g', 'y']", '"""x-axis label"""', '"""y-axis label"""', '"""Test"""'], {}), "('box', self.ValidTypicalData, [1, 4, 10, 11], ['T0',\n    'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], ['b', 'g', 'y'],\n    'x-axis label', 'y-axis label', 'Test')\n", (16456, 16627), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((18102, 18270), 'skbio.draw.boxplots', 'boxplots', (['self.ValidTypicalBoxData', '[1, 4, 10]', "['Data 1', 'Data 2', 'Data 3']", '"""Test"""', '"""x-axis label"""', '"""y-axis label"""'], {'legend': "(('blue', 'red'), ('foo', 'bar'))"}), "(self.ValidTypicalBoxData, [1, 4, 10], ['Data 1', 'Data 2',\n    'Data 3'], 'Test', 'x-axis label', 'y-axis label', legend=(('blue',\n    'red'), ('foo', 'bar')))\n", (18110, 18270), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((18716, 18840), 'skbio.draw.boxplots', 'boxplots', (['[[1, 2, 3], [], [4, 5, 6]]', '[1, 4, 10]', "['Data 1', 'Data 2', 'Data 3']", '"""Test"""', '"""x-axis label"""', '"""y-axis label"""'], {}), "([[1, 2, 3], [], [4, 5, 6]], [1, 4, 10], ['Data 1', 'Data 2',\n    'Data 3'], 'Test', 'x-axis label', 'y-axis label')\n", (18724, 18840), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((19739, 19849), 'skbio.draw.boxplots', 'boxplots', (['[[], [], []]', '[1, 4, 10]', "['Data 1', 'Data 2', 'Data 3']", '"""Test"""', '"""x-axis label"""', '"""y-axis label"""'], {}), "([[], [], []], [1, 4, 10], ['Data 1', 'Data 2', 'Data 3'], 'Test',\n    'x-axis label', 'y-axis label')\n", (19747, 19849), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((20544, 20604), 'skbio.draw.boxplots', 'boxplots', (['[[], [], []]'], {'box_colors': "['blue', 'red', 'yellow']"}), "([[], [], []], box_colors=['blue', 'red', 'yellow'])\n", (20552, 20604), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((21197, 21238), 'skbio.draw.boxplots', 'boxplots', (['[[], [], []]'], {'box_colors': '"""pink"""'}), "([[], [], []], box_colors='pink')\n", (21205, 21238), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((21626, 21695), 'skbio.draw.boxplots', 'boxplots', (['[[], [1, 2, 3.5], []]'], {'box_colors': "['blue', 'red', 'yellow']"}), "([[], [1, 2, 3.5], []], box_colors=['blue', 'red', 'yellow'])\n", (21634, 21695), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((22764, 22778), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (22776, 22778), True, 'import matplotlib.pyplot as plt\n'), ((22798, 22835), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['self.ValidTypicalBoxData'], {}), '(self.ValidTypicalBoxData)\n', (22809, 22835), True, 'import matplotlib.pyplot as plt\n'), ((22844, 22901), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', (['ax', 'box_plot', "['blue', 'w', (1, 1, 0.9)]"], {}), "(ax, box_plot, ['blue', 'w', (1, 1, 0.9)])\n", (22859, 22901), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((22953, 22967), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (22965, 22967), True, 'import matplotlib.pyplot as plt\n'), ((22987, 23024), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['self.ValidTypicalBoxData'], {}), '(self.ValidTypicalBoxData)\n', (22998, 23024), True, 'import matplotlib.pyplot as plt\n'), ((23033, 23091), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', (['ax', 'box_plot', "['blue', None, (1, 1, 0.9)]"], {}), "(ax, box_plot, ['blue', None, (1, 1, 0.9)])\n", (23048, 23091), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23142, 23156), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (23154, 23156), True, 'import matplotlib.pyplot as plt\n'), ((23176, 23213), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['self.ValidTypicalBoxData'], {}), '(self.ValidTypicalBoxData)\n', (23187, 23213), True, 'import matplotlib.pyplot as plt\n'), ((23222, 23271), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', (['ax', 'box_plot', '[None, None, None]'], {}), '(ax, box_plot, [None, None, None])\n', (23237, 23271), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23365, 23379), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (23377, 23379), True, 'import matplotlib.pyplot as plt\n'), ((23399, 23436), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['self.ValidTypicalBoxData'], {}), '(self.ValidTypicalBoxData)\n', (23410, 23436), True, 'import matplotlib.pyplot as plt\n'), ((23606, 23620), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (23618, 23620), True, 'import matplotlib.pyplot as plt\n'), ((23640, 23677), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['self.ValidTypicalBoxData'], {}), '(self.ValidTypicalBoxData)\n', (23651, 23677), True, 'import matplotlib.pyplot as plt\n'), ((24882, 24896), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (24894, 24896), True, 'import matplotlib.pyplot as plt\n'), ((24905, 25035), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""foo"""', '"""x_foo"""', '"""y_foo"""'], {'x_tick_labels': "['foofoofoo', 'barbarbar']", 'x_tick_labels_orientation': '"""vertical"""'}), "(ax, 'foo', 'x_foo', 'y_foo', x_tick_labels=['foofoofoo',\n    'barbarbar'], x_tick_labels_orientation='vertical')\n", (24922, 25035), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((25092, 25119), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', (['fig', '(3)', '(4)'], {}), '(fig, 3, 4)\n', (25108, 25119), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((25255, 25269), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (25267, 25269), True, 'import matplotlib.pyplot as plt\n'), ((25278, 25408), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""foo"""', '"""x_foo"""', '"""y_foo"""'], {'x_tick_labels': "['foofoofoo', 'barbarbar']", 'x_tick_labels_orientation': '"""vertical"""'}), "(ax, 'foo', 'x_foo', 'y_foo', x_tick_labels=['foofoofoo',\n    'barbarbar'], x_tick_labels_orientation='vertical')\n", (25295, 25408), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((25511, 25532), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', (['fig'], {}), '(fig)\n', (25527, 25532), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((25674, 25688), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (25686, 25688), True, 'import matplotlib.pyplot as plt\n'), ((25697, 25827), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""foo"""', '"""x_foo"""', '"""y_foo"""'], {'x_tick_labels': "['foofoofoo', 'barbarbar']", 'x_tick_labels_orientation': '"""vertical"""'}), "(ax, 'foo', 'x_foo', 'y_foo', x_tick_labels=['foofoofoo',\n    'barbarbar'], x_tick_labels_orientation='vertical')\n", (25714, 25827), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((25930, 25958), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', (['fig', '(-1)', '(0)'], {}), '(fig, -1, 0)\n', (25946, 25958), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((26104, 26118), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (26116, 26118), True, 'import matplotlib.pyplot as plt\n'), ((26127, 26354), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""foo"""', '"""x_foo"""', '"""y_foo"""'], {'x_tick_labels': "['foofoofooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'\n    , 'barbarbar']", 'x_tick_labels_orientation': '"""vertical"""'}), "(ax, 'foo', 'x_foo', 'y_foo', x_tick_labels=[\n    'foofoofooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'\n    , 'barbarbar'], x_tick_labels_orientation='vertical')\n", (26144, 26354), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((26537, 26598), 'numpy.testing.assert_warns', 'npt.assert_warns', (['RuntimeWarning', '_set_figure_size', 'fig', '(3)', '(3)'], {}), '(RuntimeWarning, _set_figure_size, fig, 3, 3)\n', (26553, 26598), True, 'import numpy.testing as npt\n'), ((2639, 2668), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (2656, 2668), True, 'import numpy.testing as npt\n'), ((2682, 2726), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.Null', 'None', 'None', 'None'], {}), '(self.Null, None, None, None)\n', (2697, 2726), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((2782, 2811), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (2799, 2811), True, 'import numpy.testing as npt\n'), ((2825, 2870), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.Empty', 'None', 'None', 'None'], {}), '(self.Empty, None, None, None)\n', (2840, 2870), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((2933, 2962), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (2950, 2962), True, 'import numpy.testing as npt\n'), ((2976, 3027), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.EmptyNested', 'None', 'None', 'None'], {}), '(self.EmptyNested, None, None, None)\n', (2991, 3027), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((3368, 3397), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (3385, 3397), True, 'import numpy.testing as npt\n'), ((3411, 3471), 'skbio.draw._distributions._validate_input', '_validate_input', (['[[[1, 2, 3], [4, 5]], []]', 'None', 'None', 'None'], {}), '([[[1, 2, 3], [4, 5]], []], None, None, None)\n', (3426, 3471), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((3541, 3570), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (3558, 3570), True, 'import numpy.testing as npt\n'), ((3584, 3641), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.InvalidNumSamples', 'None', 'None', 'None'], {}), '(self.InvalidNumSamples, None, None, None)\n', (3599, 3641), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((3716, 3745), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (3733, 3745), True, 'import numpy.testing as npt\n'), ((3759, 3828), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.ValidSingleSampleData', 'None', "['T0', 'T1']", 'None'], {}), "(self.ValidSingleSampleData, None, ['T0', 'T1'], None)\n", (3774, 3828), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((3927, 3956), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (3944, 3956), True, 'import numpy.testing as npt\n'), ((3970, 4043), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.ValidSingleSampleData', 'None', 'None', "['Men', 'Women']"], {}), "(self.ValidSingleSampleData, None, None, ['Men', 'Women'])\n", (3985, 4043), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((4149, 4265), 'skbio.draw._distributions._validate_input', '_validate_input', (['self.ValidTypicalData', '[1, 3, 4, 8]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']"], {}), "(self.ValidTypicalData, [1, 3, 4, 8], ['T0', 'T1', 'T2',\n    'T3'], ['Infants', 'Children', 'Teens'])\n", (4164, 4265), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((4447, 4476), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (4464, 4476), True, 'import numpy.testing as npt\n'), ((4681, 4710), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (4698, 4710), True, 'import numpy.testing as npt\n'), ((4861, 4890), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (4878, 4890), True, 'import numpy.testing as npt\n'), ((5199, 5243), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""colors"""', 'None', '(5)'], {}), "('colors', None, 5)\n", (5224, 5243), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((5386, 5430), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""colors"""', 'None', '(4)'], {}), "('colors', None, 4)\n", (5411, 5430), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((5571, 5650), 'numpy.testing.assert_warns', 'npt.assert_warns', (['RuntimeWarning', '_get_distribution_markers', '"""colors"""', 'None', '(10)'], {}), "(RuntimeWarning, _get_distribution_markers, 'colors', None, 10)\n", (5587, 5650), True, 'import numpy.testing as npt\n'), ((5838, 5932), 'numpy.testing.assert_warns', 'npt.assert_warns', (['RuntimeWarning', '_get_distribution_markers', '"""symbols"""', "['^', '>', '<']", '(5)'], {}), "(RuntimeWarning, _get_distribution_markers, 'symbols', ['^',\n    '>', '<'], 5)\n", (5854, 5932), True, 'import numpy.testing as npt\n'), ((6141, 6170), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (6158, 6170), True, 'import numpy.testing as npt\n'), ((6184, 6226), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""shapes"""', '[]', '(3)'], {}), "('shapes', [], 3)\n", (6209, 6226), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((6311, 6356), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""symbols"""', 'None', '(0)'], {}), "('symbols', None, 0)\n", (6336, 6356), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((6387, 6433), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""symbols"""', "['^']", '(0)'], {}), "('symbols', ['^'], 0)\n", (6412, 6433), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((6519, 6548), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (6536, 6548), True, 'import numpy.testing as npt\n'), ((6562, 6606), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', (['"""symbols"""', '[]', '(-1)'], {}), "('symbols', [], -1)\n", (6587, 6606), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((7580, 7609), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (7597, 7609), True, 'import numpy.testing as npt\n'), ((7623, 7682), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', (['ax', '[1, 2, 3]', '"""red"""', '(0.5)', '(3.75)', '(1.5)', '"""var"""'], {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'var')\n", (7637, 7682), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((9535, 9564), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (9552, 9564), True, 'import numpy.testing as npt\n'), ((9578, 9618), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', (['(3)', '[1, 10.5]'], {}), '(3, [1, 10.5])\n', (9604, 9618), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((10024, 10064), 'numpy.array', 'np.array', (['[1, 1.33333333, 3.33333333, 4]'], {}), '([1, 1.33333333, 3.33333333, 4])\n', (10032, 10064), True, 'import numpy as np\n'), ((10253, 10293), 'numpy.array', 'np.array', (['[1.33333333, 1, 4, 3.33333333]'], {}), '([1.33333333, 1, 4, 3.33333333])\n', (10261, 10293), True, 'import numpy as np\n'), ((10487, 10515), 'numpy.array', 'np.array', (['[1, 1.58296893, 3]'], {}), '([1, 1.58296893, 3])\n', (10495, 10515), True, 'import numpy as np\n'), ((10599, 10622), 'numpy.array', 'np.array', (['[1, 5, 9, 11]'], {}), '([1, 5, 9, 11])\n', (10607, 10622), True, 'import numpy as np\n'), ((10748, 10761), 'numpy.array', 'np.array', (['[0]'], {}), '([0])\n', (10756, 10761), True, 'import numpy as np\n'), ((12435, 12464), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (12452, 12464), True, 'import numpy.testing as npt\n'), ((12478, 12606), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""Plot Title"""', '"""x-axis label"""', '"""y-axis label"""'], {'x_tick_labels': "['T0', 'T1', 'T2']", 'y_min': '"""car"""', 'y_max': '(30)'}), "(ax, 'Plot Title', 'x-axis label', 'y-axis label',\n    x_tick_labels=['T0', 'T1', 'T2'], y_min='car', y_max=30)\n", (12495, 12606), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((12781, 12810), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (12798, 12810), True, 'import numpy.testing as npt\n'), ((12824, 12960), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (['ax', '"""Plot Title"""', '"""x-axis label"""', '"""y-axis label"""'], {'x_tick_labels': "['T0', 'T1']", 'x_tick_labels_orientation': '"""brofist"""'}), "(ax, 'Plot Title', 'x-axis label', 'y-axis label',\n    x_tick_labels=['T0', 'T1'], x_tick_labels_orientation='brofist')\n", (12841, 12960), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((13514, 13543), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (13531, 13543), True, 'import numpy.testing as npt\n'), ((13557, 13623), 'skbio.draw._distributions._create_legend', '_create_legend', (['ax', "['^', '<', '>']", "['dist1', 'dist2']", '"""symbols"""'], {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2'], 'symbols')\n", (13571, 13623), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((13637, 13666), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (13654, 13666), True, 'import numpy.testing as npt\n'), ((13680, 13751), 'skbio.draw._distributions._create_legend', '_create_legend', (['ax', "['^', '<', '>']", "['dist1', 'dist2', 'dist3']", '"""foo"""'], {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'], 'foo')\n", (13694, 13751), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((17194, 17223), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (17211, 17223), True, 'import numpy.testing as npt\n'), ((17237, 17429), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['"""pie"""', 'self.ValidTypicalData', '[1, 4, 10, 11]', "['T0', 'T1', 'T2', 'T3']", "['Infants', 'Children', 'Teens']", "['b', 'g', 'y']", '"""x-axis label"""', '"""y-axis label"""', '"""Test"""'], {}), "('pie', self.ValidTypicalData, [1, 4, 10, 11], ['T0',\n    'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], ['b', 'g', 'y'],\n    'x-axis label', 'y-axis label', 'Test')\n", (17258, 17429), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((17897, 17947), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['*args'], {'distribution_width': '(0)'}), '(*args, distribution_width=0)\n', (17918, 17947), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((18005, 18057), 'skbio.draw.grouped_distributions', 'grouped_distributions', (['*args'], {'distribution_width': '(-42)'}), '(*args, distribution_width=-42)\n', (18026, 18057), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((22063, 22095), 'numpy.isnan', 'np.isnan', (['ax.patches[0].xy[0][1]'], {}), '(ax.patches[0].xy[0][1])\n', (22071, 22095), True, 'import numpy as np\n'), ((22122, 22154), 'numpy.isnan', 'np.isnan', (['ax.patches[1].xy[0][1]'], {}), '(ax.patches[1].xy[0][1])\n', (22130, 22154), True, 'import numpy as np\n'), ((22180, 22212), 'numpy.isnan', 'np.isnan', (['ax.patches[2].xy[0][1]'], {}), '(ax.patches[2].xy[0][1])\n', (22188, 22212), True, 'import numpy as np\n'), ((22318, 22347), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (22335, 22347), True, 'import numpy.testing as npt\n'), ((22361, 22386), 'skbio.draw.boxplots', 'boxplots', (["[[1, 'foo', 3]]"], {}), "([[1, 'foo', 3]])\n", (22369, 22386), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((22467, 22496), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (22484, 22496), True, 'import numpy.testing as npt\n'), ((22510, 22574), 'skbio.draw.boxplots', 'boxplots', (['[[1, 2, 3], [], [4, 5, 6]]'], {'box_colors': "['blue', 'red']"}), "([[1, 2, 3], [], [4, 5, 6]], box_colors=['blue', 'red'])\n", (22518, 22574), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((22615, 22644), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (22632, 22644), True, 'import numpy.testing as npt\n'), ((22658, 22709), 'skbio.draw.boxplots', 'boxplots', (['[[1, 2, 3]]'], {'legend': "('foo', 'bar', 'baz')"}), "([[1, 2, 3]], legend=('foo', 'bar', 'baz'))\n", (22666, 22709), False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((23450, 23479), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (23467, 23479), True, 'import numpy.testing as npt\n'), ((23493, 23552), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', (['ax', 'box_plot', "['red', 'foobarbaz', 'blue']"], {}), "(ax, box_plot, ['red', 'foobarbaz', 'blue'])\n", (23508, 23552), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23691, 23720), 'numpy.testing.assert_raises', 'npt.assert_raises', (['ValueError'], {}), '(ValueError)\n', (23708, 23720), True, 'import numpy.testing as npt\n'), ((23734, 23786), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', (['ax', 'box_plot', "['blue', (1, 1, 0.9)]"], {}), "(ax, box_plot, ['blue', (1, 1, 0.9)])\n", (23749, 23786), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23859, 23891), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['"""w"""'], {}), "('w')\n", (23886, 23891), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23917, 23953), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['"""white"""'], {}), "('white')\n", (23944, 23953), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((23979, 24017), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['[1, 1, 1]'], {}), '([1, 1, 1])\n', (24006, 24017), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24043, 24084), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['[1, 1, 1, 1]'], {}), '([1, 1, 1, 1])\n', (24070, 24084), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24110, 24148), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['(1, 1, 1)'], {}), '((1, 1, 1))\n', (24137, 24148), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24174, 24215), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['(1, 1, 1, 1)'], {}), '((1, 1, 1, 1))\n', (24201, 24215), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24241, 24290), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['(1.0, 1.0, 1.0, 1.0)'], {}), '((1.0, 1.0, 1.0, 1.0))\n', (24268, 24290), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24316, 24358), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['(1.0, 1, 1.0)'], {}), '((1.0, 1, 1.0))\n', (24343, 24358), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24384, 24426), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['(2.0, 1, 1.0)'], {}), '((2.0, 1, 1.0))\n', (24411, 24426), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24454, 24493), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (["['w', 'r']"], {}), "(['w', 'r'])\n", (24481, 24493), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24520, 24554), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (["['w']"], {}), "(['w'])\n", (24547, 24554), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24581, 24616), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (["('w',)"], {}), "(('w',))\n", (24608, 24616), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24643, 24688), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['((1.0, 1.0, 1),)'], {}), '(((1.0, 1.0, 1),))\n', (24670, 24688), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((24715, 24771), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', (['((1.0, 1.0, 1), (0.9, 0.9))'], {}), '(((1.0, 1.0, 1), (0.9, 0.9)))\n', (24742, 24771), False, 'from skbio.draw._distributions import _calc_data_point_locations, _calc_data_point_ticks, _color_box_plot, _create_legend, _get_distribution_markers, _is_single_matplotlib_color, _plot_bar_data, _plot_box_data, _plot_scatter_data, _set_axes_options, _set_figure_size, _validate_input, _validate_x_values\n'), ((21156, 21180), 'numpy.isnan', 'np.isnan', (['patch.xy[0][1]'], {}), '(patch.xy[0][1])\n', (21164, 21180), True, 'import numpy as np\n'), ((21529, 21553), 'numpy.isnan', 'np.isnan', (['patch.xy[0][1]'], {}), '(patch.xy[0][1])\n', (21537, 21553), True, 'import numpy as np\n')]