diff options
author | Javi Merino <javi.merino@arm.com> | 2014-06-17 17:21:20 +0100 |
---|---|---|
committer | Javi Merino <javi.merino@arm.com> | 2015-08-12 14:52:38 +0100 |
commit | 4402e316cdca54268ceabd842188616a104e00e4 (patch) | |
tree | 17ce29dd26bcbb80fb1e4bc0c6a5f25119ae0405 /tests/test_plot_utils.py | |
parent | c0e104d3a5bbabb5e98de63f7bd920e1c9a12e36 (diff) | |
download | trappy-4402e316cdca54268ceabd842188616a104e00e4.tar.gz |
plot_utils: move setting ylim to after the plot has been drawn
If we want to recalculate the ylims, it needs to happen after it has
been plotted.
Diffstat (limited to 'tests/test_plot_utils.py')
-rw-r--r-- | tests/test_plot_utils.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_plot_utils.py b/tests/test_plot_utils.py index a80f7b6..4cd5adb 100644 --- a/tests/test_plot_utils.py +++ b/tests/test_plot_utils.py @@ -2,6 +2,8 @@ import unittest +from matplotlib import pyplot as plt + import plot_utils class TestPlotUtils(unittest.TestCase): @@ -19,5 +21,9 @@ class TestPlotUtils(unittest.TestCase): def test_default_plot_settings(self): """Test that plot_utils.default_plot_settings() doesn't bomb""" - plot_utils.default_plot_settings() - plot_utils.default_plot_settings(title="Foo") + + _, ax = plt.subplots() + + plot_utils.default_plot_settings(ax) + plot_utils.default_plot_settings(ax, title="Foo") + plot_utils.default_plot_settings(ax, ylim=(0, 72)) |