# ----------------------------------------------------------------------------
# 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()

[((576, 4, 576, 10), 'unittest.main', 'main', ({}, {}), '()', False, 'from unittest import TestCase, main\n'), ((63, 8, 63, 24), 'matplotlib.pyplot.close', 'plt.close', ({(63, 18, 63, 23): '"""all"""'}, {}), "('all')", True, 'import matplotlib.pyplot as plt\n'), ((78, 34, 79, 67), 'skbio.draw._distributions._validate_input', '_validate_input', ({(78, 50, 78, 72): 'self.EmptyDeeplyNested', (79, 50, 79, 54): 'None', (79, 56, 79, 60): 'None', (79, 62, 79, 66): 'None'}, {}), '(self.EmptyDeeplyNested, None, None, None)', 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'), ((122, 8, 122, 48), 'skbio.draw._distributions._validate_x_values', '_validate_x_values', ({(122, 27, 122, 38): '[1, 2.0, 3]', (122, 40, 122, 44): 'None', (122, 46, 122, 47): '(3)'}, {}), '([1, 2.0, 3], None, 3)', 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'), ((155, 18, 155, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((156, 17, 156, 77), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', ({(156, 32, 156, 34): 'ax', (156, 36, 156, 45): '[1, 2, 3]', (156, 47, 156, 52): '"""red"""', (156, 54, 156, 57): '0.5', (156, 59, 156, 63): '3.75', (156, 65, 156, 68): '1.5', (156, 70, 156, 76): '"""stdv"""'}, {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'stdv')", 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'), ((163, 18, 163, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((164, 17, 164, 76), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', ({(164, 32, 164, 34): 'ax', (164, 36, 164, 45): '[1, 2, 3]', (164, 47, 164, 52): '"""red"""', (164, 54, 164, 57): '0.5', (164, 59, 164, 63): '3.75', (164, 65, 164, 68): '1.5', (164, 70, 164, 75): '"""sem"""'}, {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'sem')", 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'), ((172, 18, 172, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((177, 18, 177, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((178, 17, 178, 70), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', ({(178, 32, 178, 34): 'ax', (178, 36, 178, 38): '[]', (178, 40, 178, 45): '"""red"""', (178, 47, 178, 50): '0.5', (178, 52, 178, 56): '3.75', (178, 58, 178, 61): '1.5', (178, 63, 178, 69): '"""stdv"""'}, {}), "(ax, [], 'red', 0.5, 3.75, 1.5, 'stdv')", 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'), ((181, 18, 181, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((182, 17, 182, 69), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', ({(182, 32, 182, 34): 'ax', (182, 36, 182, 38): '[]', (182, 40, 182, 45): '"""red"""', (182, 47, 182, 50): '0.5', (182, 52, 182, 56): '3.75', (182, 58, 182, 61): '1.5', (182, 63, 182, 68): '"""sem"""'}, {}), "(ax, [], 'red', 0.5, 3.75, 1.5, 'sem')", 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'), ((186, 18, 186, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((187, 17, 187, 77), 'skbio.draw._distributions._plot_scatter_data', '_plot_scatter_data', ({(187, 36, 187, 38): 'ax', (187, 40, 187, 49): '[1, 2, 3]', (187, 51, 187, 54): '"""^"""', (187, 56, 187, 60): '0.77', (187, 62, 187, 63): '1', (187, 65, 187, 68): '1.5', (187, 70, 187, 76): '"""stdv"""'}, {}), "(ax, [1, 2, 3], '^', 0.77, 1, 1.5, 'stdv')", 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'), ((191, 18, 191, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((192, 17, 192, 70), 'skbio.draw._distributions._plot_scatter_data', '_plot_scatter_data', ({(192, 36, 192, 38): 'ax', (192, 40, 192, 42): '[]', (192, 44, 192, 47): '"""^"""', (192, 49, 192, 53): '0.77', (192, 55, 192, 56): '1', (192, 58, 192, 61): '1.5', (192, 63, 192, 69): '"""stdv"""'}, {}), "(ax, [], '^', 0.77, 1, 1.5, 'stdv')", 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'), ((196, 18, 196, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((197, 17, 198, 44), 'skbio.draw._distributions._plot_box_data', '_plot_box_data', ({(197, 32, 197, 34): 'ax', (197, 36, 197, 56): '[0, 0, 7, 8, -3, 44]', (197, 58, 197, 64): '"""blue"""', (197, 66, 197, 70): '0.33', (197, 72, 197, 74): '55', (198, 32, 198, 35): '1.5', (198, 37, 198, 43): '"""stdv"""'}, {}), "(ax, [0, 0, 7, 8, -3, 44], 'blue', 0.33, 55, 1.5, 'stdv')", 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'), ((215, 18, 215, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((216, 17, 216, 70), 'skbio.draw._distributions._plot_box_data', '_plot_box_data', ({(216, 32, 216, 34): 'ax', (216, 36, 216, 38): '[]', (216, 40, 216, 46): '"""blue"""', (216, 48, 216, 52): '0.33', (216, 54, 216, 56): '55', (216, 58, 216, 61): '1.5', (216, 63, 216, 69): '"""stdv"""'}, {}), "(ax, [], 'blue', 0.33, 55, 1.5, 'stdv')", 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'), ((224, 15, 224, 44), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', ({(224, 42, 224, 43): '4'}, {}), '(4)', 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'), ((225, 8, 225, 54), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', ({(225, 35, 225, 39): 'locs', (225, 41, 225, 53): '[1, 2, 3, 4]'}, {}), '(locs, [1, 2, 3, 4])', True, 'import numpy as np\n'), ((229, 15, 229, 60), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', ({(229, 42, 229, 43): '4', (229, 45, 229, 59): '[3, 4, 10, 12]'}, {}), '(4, [3, 4, 10, 12])', 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'), ((234, 15, 234, 60), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', ({(234, 42, 234, 43): '4', (234, 45, 234, 59): '[4, 3, 12, 10]'}, {}), '(4, [4, 3, 12, 10])', 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'), ((239, 15, 239, 67), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', ({(239, 42, 239, 43): '3', (239, 45, 239, 66): '[0.001, 0.2543, 0.87]'}, {}), '(3, [0.001, 0.2543, 0.87])', 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'), ((245, 8, 245, 68), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', ({(245, 35, 245, 40): 'ticks', (245, 42, 245, 67): '[1.25, 5.25, 9.25, 11.25]'}, {}), '(ticks, [1.25, 5.25, 9.25, 11.25])', True, 'import numpy as np\n'), ((248, 8, 248, 49), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', ({(248, 35, 248, 40): 'ticks', (248, 42, 248, 48): '[0.75]'}, {}), '(ticks, [0.75])', True, 'import numpy as np\n'), ((251, 18, 251, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((252, 8, 253, 53), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((260, 18, 260, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((261, 8, 262, 77), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((270, 18, 270, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((271, 8, 272, 49), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((281, 18, 281, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((288, 18, 288, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((295, 18, 295, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((296, 8, 296, 68), 'skbio.draw._distributions._create_legend', '_create_legend', ({(296, 23, 296, 25): 'ax', (296, 27, 296, 37): "['b', 'r']", (296, 39, 296, 57): "['dist1', 'dist2']", (296, 59, 296, 67): '"""colors"""'}, {}), "(ax, ['b', 'r'], ['dist1', 'dist2'], 'colors')", 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'), ((299, 18, 299, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((300, 8, 301, 33), 'skbio.draw._distributions._create_legend', '_create_legend', ({(300, 23, 300, 25): 'ax', (300, 27, 300, 42): "['^', '<', '>']", (300, 44, 300, 71): "['dist1', 'dist2', 'dist3']", (301, 23, 301, 32): '"""symbols"""'}, {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'], 'symbols')", 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'), ((305, 18, 305, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((313, 14, 317, 59), 'skbio.draw.grouped_distributions', 'grouped_distributions', ({(313, 36, 313, 41): '"""bar"""', (313, 43, 313, 64): 'self.ValidTypicalData', (314, 36, 314, 50): '[1, 4, 10, 11]', (314, 52, 314, 76): "['T0', 'T1', 'T2', 'T3']", (315, 36, 315, 68): "['Infants', 'Children', 'Teens']", (316, 36, 316, 51): "['b', 'r', 'g']", (316, 53, 316, 67): '"""x-axis label"""', (317, 36, 317, 50): '"""y-axis label"""', (317, 52, 317, 58): '"""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')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((331, 8, 333, 31), 'numpy.testing.assert_warns', 'npt.assert_warns', ({(331, 25, 331, 39): 'RuntimeWarning', (332, 25, 332, 46): 'grouped_distributions', (333, 25, 333, 30): '*args'}, {}), '(RuntimeWarning, grouped_distributions, *args)', True, 'import numpy.testing as npt\n'), ((336, 14, 340, 59), 'skbio.draw.grouped_distributions', 'grouped_distributions', ({(336, 36, 336, 45): '"""scatter"""', (336, 47, 336, 68): 'self.ValidTypicalData', (337, 36, 337, 50): '[1, 4, 10, 11]', (337, 52, 337, 76): "['T0', 'T1', 'T2', 'T3']", (338, 36, 338, 68): "['Infants', 'Children', 'Teens']", (339, 36, 339, 51): "['^', '>', '<']", (339, 53, 339, 67): '"""x-axis label"""', (340, 36, 340, 50): '"""y-axis label"""', (340, 52, 340, 58): '"""Test"""'}, {}), "('scatter', self.ValidTypicalData, [1, 4, 10, 11], [\n    'T0', 'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], ['^', '>',\n    '<'], 'x-axis label', 'y-axis label', 'Test')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((354, 8, 354, 70), 'numpy.testing.assert_warns', 'npt.assert_warns', ({(354, 25, 354, 39): 'RuntimeWarning', (354, 41, 354, 62): 'grouped_distributions', (354, 64, 354, 69): '*args'}, {}), '(RuntimeWarning, grouped_distributions, *args)', True, 'import numpy.testing as npt\n'), ((357, 8, 360, 69), 'skbio.draw.grouped_distributions', 'grouped_distributions', ({(357, 30, 357, 39): '"""scatter"""', (357, 41, 357, 62): 'self.ValidTypicalData', (358, 30, 358, 44): '[1, 4, 10, 11]', (358, 46, 358, 70): "['T0', 'T1', 'T2', 'T3']", (359, 30, 359, 62): "['Infants', 'Children', 'Teens']", (359, 64, 359, 66): '[]', (360, 30, 360, 44): '"""x-axis label"""', (360, 46, 360, 60): '"""y-axis label"""', (360, 62, 360, 68): '"""Test"""'}, {}), "('scatter', self.ValidTypicalData, [1, 4, 10, 11], [\n    'T0', 'T1', 'T2', 'T3'], ['Infants', 'Children', 'Teens'], [],\n    'x-axis label', 'y-axis label', 'Test')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((363, 14, 367, 59), 'skbio.draw.grouped_distributions', 'grouped_distributions', ({(363, 36, 363, 41): '"""box"""', (363, 43, 363, 64): 'self.ValidTypicalData', (364, 36, 364, 50): '[1, 4, 10, 11]', (364, 52, 364, 76): "['T0', 'T1', 'T2', 'T3']", (365, 36, 365, 68): "['Infants', 'Children', 'Teens']", (366, 36, 366, 51): "['b', 'g', 'y']", (366, 53, 366, 67): '"""x-axis label"""', (367, 36, 367, 50): '"""y-axis label"""', (367, 52, 367, 58): '"""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')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((396, 14, 399, 64), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((408, 14, 410, 38), 'skbio.draw.boxplots', 'boxplots', ({(408, 23, 408, 49): '[[1, 2, 3], [], [4, 5, 6]]', (408, 51, 408, 61): '[1, 4, 10]', (409, 23, 409, 53): "['Data 1', 'Data 2', 'Data 3']", (409, 55, 409, 61): '"""Test"""', (409, 63, 409, 77): '"""x-axis label"""', (410, 23, 410, 37): '"""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')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((428, 14, 430, 38), 'skbio.draw.boxplots', 'boxplots', ({(428, 23, 428, 35): '[[], [], []]', (428, 37, 428, 47): '[1, 4, 10]', (429, 23, 429, 53): "['Data 1', 'Data 2', 'Data 3']", (429, 55, 429, 61): '"""Test"""', (429, 63, 429, 77): '"""x-axis label"""', (430, 23, 430, 37): '"""y-axis label"""'}, {}), "([[], [], []], [1, 4, 10], ['Data 1', 'Data 2', 'Data 3'], 'Test',\n    'x-axis label', 'y-axis label')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((445, 14, 445, 74), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((457, 14, 457, 55), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((467, 14, 468, 60), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((492, 18, 492, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((493, 19, 493, 56), 'matplotlib.pyplot.boxplot', 'plt.boxplot', ({(493, 31, 493, 55): 'self.ValidTypicalBoxData'}, {}), '(self.ValidTypicalBoxData)', True, 'import matplotlib.pyplot as plt\n'), ((494, 8, 494, 65), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', ({(494, 24, 494, 26): 'ax', (494, 28, 494, 36): 'box_plot', (494, 38, 494, 64): "['blue', 'w', (1, 1, 0.9)]"}, {}), "(ax, box_plot, ['blue', 'w', (1, 1, 0.9)])", 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'), ((497, 18, 497, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((498, 19, 498, 56), 'matplotlib.pyplot.boxplot', 'plt.boxplot', ({(498, 31, 498, 55): 'self.ValidTypicalBoxData'}, {}), '(self.ValidTypicalBoxData)', True, 'import matplotlib.pyplot as plt\n'), ((499, 8, 499, 66), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', ({(499, 24, 499, 26): 'ax', (499, 28, 499, 36): 'box_plot', (499, 38, 499, 65): "['blue', None, (1, 1, 0.9)]"}, {}), "(ax, box_plot, ['blue', None, (1, 1, 0.9)])", 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'), ((502, 18, 502, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((503, 19, 503, 56), 'matplotlib.pyplot.boxplot', 'plt.boxplot', ({(503, 31, 503, 55): 'self.ValidTypicalBoxData'}, {}), '(self.ValidTypicalBoxData)', True, 'import matplotlib.pyplot as plt\n'), ((504, 8, 504, 57), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', ({(504, 24, 504, 26): 'ax', (504, 28, 504, 36): 'box_plot', (504, 38, 504, 56): '[None, None, None]'}, {}), '(ax, box_plot, [None, None, None])', 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'), ((508, 18, 508, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((509, 19, 509, 56), 'matplotlib.pyplot.boxplot', 'plt.boxplot', ({(509, 31, 509, 55): 'self.ValidTypicalBoxData'}, {}), '(self.ValidTypicalBoxData)', True, 'import matplotlib.pyplot as plt\n'), ((514, 18, 514, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((515, 19, 515, 56), 'matplotlib.pyplot.boxplot', 'plt.boxplot', ({(515, 31, 515, 55): 'self.ValidTypicalBoxData'}, {}), '(self.ValidTypicalBoxData)', True, 'import matplotlib.pyplot as plt\n'), ((538, 18, 538, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((539, 8, 541, 63), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((542, 8, 542, 35), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', ({(542, 25, 542, 28): 'fig', (542, 30, 542, 31): '(3)', (542, 33, 542, 34): '(4)'}, {}), '(fig, 3, 4)', 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'), ((546, 18, 546, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((547, 8, 549, 63), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((551, 8, 551, 29), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', ({(551, 25, 551, 28): 'fig'}, {}), '(fig)', 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'), ((555, 18, 555, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((556, 8, 558, 63), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((560, 8, 560, 36), 'skbio.draw._distributions._set_figure_size', '_set_figure_size', ({(560, 25, 560, 28): 'fig', (560, 30, 560, 32): '(-1)', (560, 34, 560, 35): '(0)'}, {}), '(fig, -1, 0)', 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'), ((564, 18, 564, 32), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((565, 8, 570, 63), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((571, 8, 571, 69), 'numpy.testing.assert_warns', 'npt.assert_warns', ({(571, 25, 571, 39): 'RuntimeWarning', (571, 41, 571, 57): '_set_figure_size', (571, 59, 571, 62): 'fig', (571, 64, 571, 65): '(3)', (571, 67, 571, 68): '(3)'}, {}), '(RuntimeWarning, _set_figure_size, fig, 3, 3)', True, 'import numpy.testing as npt\n'), ((66, 13, 66, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(66, 31, 66, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((67, 12, 67, 56), 'skbio.draw._distributions._validate_input', '_validate_input', ({(67, 28, 67, 37): 'self.Null', (67, 39, 67, 43): 'None', (67, 45, 67, 49): 'None', (67, 51, 67, 55): 'None'}, {}), '(self.Null, None, None, None)', 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'), ((70, 13, 70, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(70, 31, 70, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((71, 12, 71, 57), 'skbio.draw._distributions._validate_input', '_validate_input', ({(71, 28, 71, 38): 'self.Empty', (71, 40, 71, 44): 'None', (71, 46, 71, 50): 'None', (71, 52, 71, 56): 'None'}, {}), '(self.Empty, None, None, None)', 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'), ((74, 13, 74, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(74, 31, 74, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((75, 12, 75, 63), 'skbio.draw._distributions._validate_input', '_validate_input', ({(75, 28, 75, 44): 'self.EmptyNested', (75, 46, 75, 50): 'None', (75, 52, 75, 56): 'None', (75, 58, 75, 62): 'None'}, {}), '(self.EmptyNested, None, None, None)', 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'), ((84, 13, 84, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(84, 31, 84, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((85, 12, 85, 72), 'skbio.draw._distributions._validate_input', '_validate_input', ({(85, 28, 85, 53): '[[[1, 2, 3], [4, 5]], []]', (85, 55, 85, 59): 'None', (85, 61, 85, 65): 'None', (85, 67, 85, 71): 'None'}, {}), '([[[1, 2, 3], [4, 5]], []], None, None, None)', 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'), ((88, 13, 88, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(88, 31, 88, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((89, 12, 89, 69), 'skbio.draw._distributions._validate_input', '_validate_input', ({(89, 28, 89, 50): 'self.InvalidNumSamples', (89, 52, 89, 56): 'None', (89, 58, 89, 62): 'None', (89, 64, 89, 68): 'None'}, {}), '(self.InvalidNumSamples, None, None, None)', 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'), ((92, 13, 92, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(92, 31, 92, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((93, 12, 94, 33), 'skbio.draw._distributions._validate_input', '_validate_input', ({(93, 28, 93, 54): 'self.ValidSingleSampleData', (93, 56, 93, 60): 'None', (93, 62, 93, 74): "['T0', 'T1']", (94, 28, 94, 32): 'None'}, {}), "(self.ValidSingleSampleData, None, ['T0', 'T1'], None)", 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'), ((97, 13, 97, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(97, 31, 97, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((98, 12, 99, 45), 'skbio.draw._distributions._validate_input', '_validate_input', ({(98, 28, 98, 54): 'self.ValidSingleSampleData', (98, 56, 98, 60): 'None', (98, 62, 98, 66): 'None', (99, 28, 99, 44): "['Men', 'Women']"}, {}), "(self.ValidSingleSampleData, None, None, ['Men', 'Women'])", 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'), ((102, 25, 104, 74), 'skbio.draw._distributions._validate_input', '_validate_input', ({(102, 41, 102, 62): 'self.ValidTypicalData', (102, 64, 102, 76): '[1, 3, 4, 8]', (103, 41, 103, 65): "['T0', 'T1', 'T2', 'T3']", (104, 41, 104, 73): "['Infants', 'Children', 'Teens']"}, {}), "(self.ValidTypicalData, [1, 3, 4, 8], ['T0', 'T1', 'T2',\n    'T3'], ['Infants', 'Children', 'Teens'])", 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'), ((108, 13, 108, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(108, 31, 108, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((113, 13, 113, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(113, 31, 113, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((117, 13, 117, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(117, 31, 117, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((125, 25, 125, 69), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(125, 51, 125, 59): '"""colors"""', (125, 61, 125, 65): 'None', (125, 67, 125, 68): '(5)'}, {}), "('colors', None, 5)", 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'), ((129, 25, 129, 69), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(129, 51, 129, 59): '"""colors"""', (129, 61, 129, 65): 'None', (129, 67, 129, 68): '(4)'}, {}), "('colors', None, 4)", 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'), ((133, 25, 135, 61), 'numpy.testing.assert_warns', 'npt.assert_warns', ({(133, 42, 133, 56): 'RuntimeWarning', (134, 42, 134, 67): '_get_distribution_markers', (135, 42, 135, 50): '"""colors"""', (135, 52, 135, 56): 'None', (135, 58, 135, 60): '(10)'}, {}), "(RuntimeWarning, _get_distribution_markers, 'colors', None, 10)", True, 'import numpy.testing as npt\n'), ((137, 25, 139, 72), 'numpy.testing.assert_warns', 'npt.assert_warns', ({(137, 42, 137, 56): 'RuntimeWarning', (138, 42, 138, 67): '_get_distribution_markers', (139, 42, 139, 51): '"""symbols"""', (139, 53, 139, 68): "['^', '>', '<']", (139, 70, 139, 71): '(5)'}, {}), "(RuntimeWarning, _get_distribution_markers, 'symbols', ['^',\n    '>', '<'], 5)", True, 'import numpy.testing as npt\n'), ((143, 13, 143, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(143, 31, 143, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((144, 12, 144, 54), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(144, 38, 144, 46): '"""shapes"""', (144, 48, 144, 50): '[]', (144, 52, 144, 53): '(3)'}, {}), "('shapes', [], 3)", 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'), ((147, 25, 147, 70), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(147, 51, 147, 60): '"""symbols"""', (147, 62, 147, 66): 'None', (147, 68, 147, 69): '(0)'}, {}), "('symbols', None, 0)", 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'), ((148, 25, 148, 71), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(148, 51, 148, 60): '"""symbols"""', (148, 62, 148, 67): "['^']", (148, 69, 148, 70): '(0)'}, {}), "('symbols', ['^'], 0)", 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'), ((151, 13, 151, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(151, 31, 151, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((152, 12, 152, 56), 'skbio.draw._distributions._get_distribution_markers', '_get_distribution_markers', ({(152, 38, 152, 47): '"""symbols"""', (152, 49, 152, 51): '[]', (152, 53, 152, 55): '(-1)'}, {}), "('symbols', [], -1)", 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'), ((173, 13, 173, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(173, 31, 173, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((174, 12, 174, 71), 'skbio.draw._distributions._plot_bar_data', '_plot_bar_data', ({(174, 27, 174, 29): 'ax', (174, 31, 174, 40): '[1, 2, 3]', (174, 42, 174, 47): '"""red"""', (174, 49, 174, 52): '(0.5)', (174, 54, 174, 58): '(3.75)', (174, 60, 174, 63): '(1.5)', (174, 65, 174, 70): '"""var"""'}, {}), "(ax, [1, 2, 3], 'red', 0.5, 3.75, 1.5, 'var')", 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'), ((220, 13, 220, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(220, 31, 220, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((221, 12, 221, 52), 'skbio.draw._distributions._calc_data_point_locations', '_calc_data_point_locations', ({(221, 39, 221, 40): '(3)', (221, 42, 221, 51): '[1, 10.5]'}, {}), '(3, [1, 10.5])', 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'), ((231, 35, 231, 75), 'numpy.array', 'np.array', ({(231, 44, 231, 74): '[1, 1.33333333, 3.33333333, 4]'}, {}), '([1, 1.33333333, 3.33333333, 4])', True, 'import numpy as np\n'), ((236, 35, 236, 75), 'numpy.array', 'np.array', ({(236, 44, 236, 74): '[1.33333333, 1, 4, 3.33333333]'}, {}), '([1.33333333, 1, 4, 3.33333333])', True, 'import numpy as np\n'), ((241, 35, 241, 63), 'numpy.array', 'np.array', ({(241, 44, 241, 62): '[1, 1.58296893, 3]'}, {}), '([1, 1.58296893, 3])', True, 'import numpy as np\n'), ((244, 39, 244, 62), 'numpy.array', 'np.array', ({(244, 48, 244, 61): '[1, 5, 9, 11]'}, {}), '([1, 5, 9, 11])', True, 'import numpy as np\n'), ((247, 39, 247, 52), 'numpy.array', 'np.array', ({(247, 48, 247, 51): '[0]'}, {}), '([0])', True, 'import numpy as np\n'), ((282, 13, 282, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(282, 31, 282, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((283, 12, 285, 39), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((289, 13, 289, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(289, 31, 289, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((290, 12, 292, 66), 'skbio.draw._distributions._set_axes_options', '_set_axes_options', (), '', 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'), ((306, 13, 306, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(306, 31, 306, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((307, 12, 307, 78), 'skbio.draw._distributions._create_legend', '_create_legend', ({(307, 27, 307, 29): 'ax', (307, 31, 307, 46): "['^', '<', '>']", (307, 48, 307, 66): "['dist1', 'dist2']", (307, 68, 307, 77): '"""symbols"""'}, {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2'], 'symbols')", 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'), ((308, 13, 308, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(308, 31, 308, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((309, 12, 310, 33), 'skbio.draw._distributions._create_legend', '_create_legend', ({(309, 27, 309, 29): 'ax', (309, 31, 309, 46): "['^', '<', '>']", (309, 48, 309, 75): "['dist1', 'dist2', 'dist3']", (310, 27, 310, 32): '"""foo"""'}, {}), "(ax, ['^', '<', '>'], ['dist1', 'dist2', 'dist3'], 'foo')", 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'), ((377, 13, 377, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(377, 31, 377, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((378, 12, 382, 73), 'skbio.draw.grouped_distributions', 'grouped_distributions', ({(378, 34, 378, 39): '"""pie"""', (378, 41, 378, 62): 'self.ValidTypicalData', (379, 34, 379, 48): '[1, 4, 10, 11]', (379, 50, 379, 74): "['T0', 'T1', 'T2', 'T3']", (380, 34, 380, 66): "['Infants', 'Children', 'Teens']", (381, 34, 381, 49): "['b', 'g', 'y']", (382, 34, 382, 48): '"""x-axis label"""', (382, 50, 382, 64): '"""y-axis label"""', (382, 66, 382, 72): '"""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')", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((390, 12, 390, 62), 'skbio.draw.grouped_distributions', 'grouped_distributions', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((393, 12, 393, 64), 'skbio.draw.grouped_distributions', 'grouped_distributions', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((474, 24, 474, 56), 'numpy.isnan', 'np.isnan', ({(474, 33, 474, 55): 'ax.patches[0].xy[0][1]'}, {}), '(ax.patches[0].xy[0][1])', True, 'import numpy as np\n'), ((475, 25, 475, 57), 'numpy.isnan', 'np.isnan', ({(475, 34, 475, 56): 'ax.patches[1].xy[0][1]'}, {}), '(ax.patches[1].xy[0][1])', True, 'import numpy as np\n'), ((476, 24, 476, 56), 'numpy.isnan', 'np.isnan', ({(476, 33, 476, 55): 'ax.patches[2].xy[0][1]'}, {}), '(ax.patches[2].xy[0][1])', True, 'import numpy as np\n'), ((480, 13, 480, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(480, 31, 480, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((481, 12, 481, 37), 'skbio.draw.boxplots', 'boxplots', ({(481, 21, 481, 36): "[[1, 'foo', 3]]"}, {}), "([[1, 'foo', 3]])", False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((484, 13, 484, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(484, 31, 484, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((485, 12, 485, 76), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((488, 13, 488, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(488, 31, 488, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((489, 12, 489, 63), 'skbio.draw.boxplots', 'boxplots', (), '', False, 'from skbio.draw import boxplots, grouped_distributions\n'), ((510, 13, 510, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(510, 31, 510, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((511, 12, 511, 71), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', ({(511, 28, 511, 30): 'ax', (511, 32, 511, 40): 'box_plot', (511, 42, 511, 70): "['red', 'foobarbaz', 'blue']"}, {}), "(ax, box_plot, ['red', 'foobarbaz', 'blue'])", 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'), ((516, 13, 516, 42), 'numpy.testing.assert_raises', 'npt.assert_raises', ({(516, 31, 516, 41): 'ValueError'}, {}), '(ValueError)', True, 'import numpy.testing as npt\n'), ((517, 12, 517, 64), 'skbio.draw._distributions._color_box_plot', '_color_box_plot', ({(517, 28, 517, 30): 'ax', (517, 32, 517, 40): 'box_plot', (517, 42, 517, 63): "['blue', (1, 1, 0.9)]"}, {}), "(ax, box_plot, ['blue', (1, 1, 0.9)])", 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'), ((520, 24, 520, 56), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(520, 52, 520, 55): '"""w"""'}, {}), "('w')", 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'), ((521, 24, 521, 60), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(521, 52, 521, 59): '"""white"""'}, {}), "('white')", 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'), ((522, 24, 522, 62), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(522, 52, 522, 61): '[1, 1, 1]'}, {}), '([1, 1, 1])', 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'), ((523, 24, 523, 65), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(523, 52, 523, 64): '[1, 1, 1, 1]'}, {}), '([1, 1, 1, 1])', 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'), ((524, 24, 524, 62), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(524, 52, 524, 61): '(1, 1, 1)'}, {}), '((1, 1, 1))', 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'), ((525, 24, 525, 65), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(525, 52, 525, 64): '(1, 1, 1, 1)'}, {}), '((1, 1, 1, 1))', 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'), ((526, 24, 526, 73), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(526, 52, 526, 72): '(1.0, 1.0, 1.0, 1.0)'}, {}), '((1.0, 1.0, 1.0, 1.0))', 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'), ((527, 24, 527, 66), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(527, 52, 527, 65): '(1.0, 1, 1.0)'}, {}), '((1.0, 1, 1.0))', 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'), ((528, 24, 528, 66), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(528, 52, 528, 65): '(2.0, 1, 1.0)'}, {}), '((2.0, 1, 1.0))', 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'), ((530, 25, 530, 64), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(530, 53, 530, 63): "['w', 'r']"}, {}), "(['w', 'r'])", 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'), ((531, 25, 531, 59), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(531, 53, 531, 58): "['w']"}, {}), "(['w'])", 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'), ((532, 25, 532, 60), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(532, 53, 532, 59): "('w',)"}, {}), "(('w',))", 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'), ((533, 25, 533, 70), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(533, 53, 533, 69): '((1.0, 1.0, 1),)'}, {}), '(((1.0, 1.0, 1),))', 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'), ((534, 25, 535, 66), 'skbio.draw._distributions._is_single_matplotlib_color', '_is_single_matplotlib_color', ({(534, 53, 535, 65): '((1.0, 1.0, 1), (0.9, 0.9))'}, {}), '(((1.0, 1.0, 1), (0.9, 0.9)))', 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'), ((455, 28, 455, 52), 'numpy.isnan', 'np.isnan', ({(455, 37, 455, 51): 'patch.xy[0][1]'}, {}), '(patch.xy[0][1])', True, 'import numpy as np\n'), ((464, 28, 464, 52), 'numpy.isnan', 'np.isnan', ({(464, 37, 464, 51): 'patch.xy[0][1]'}, {}), '(patch.xy[0][1])', True, 'import numpy as np\n')]