Skip to content
Snippets Groups Projects
Commit 706cfc16 authored by Conor Finn's avatar Conor Finn
Browse files

RE #28227 Add test for ragged colourfill creation

parent dda982b3
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ import numpy as np ...@@ -23,6 +23,7 @@ import numpy as np
# register mantid projection # register mantid projection
import mantid.plots # noqa import mantid.plots # noqa
from mantid.api import AnalysisDataService, WorkspaceFactory from mantid.api import AnalysisDataService, WorkspaceFactory
from mantid.simpleapi import CreateWorkspace
from mantid.kernel import config from mantid.kernel import config
from mantid.plots import MantidAxes from mantid.plots import MantidAxes
from mantid.py3compat import mock from mantid.py3compat import mock
...@@ -151,6 +152,11 @@ class FunctionsTest(TestCase): ...@@ -151,6 +152,11 @@ class FunctionsTest(TestCase):
pcolormesh_from_names([ws_name]) pcolormesh_from_names([ws_name])
self.assertEqual(1, pcolormesh_mock.call_count) self.assertEqual(1, pcolormesh_mock.call_count)
def test_scale_is_correct_on_pcolourmesh_of_ragged_workspace(self):
ws = CreateWorkspace(DataX=[1, 2, 3, 4, 2, 4, 6, 8], DataY=[2] * 8, NSpec=2)
fig = pcolormesh_from_names([ws])
self.assertEqual((1.8, 2.2), fig.axes[0].images[0].get_clim())
def test_pcolormesh_from_names(self): def test_pcolormesh_from_names(self):
ws_name = 'test_pcolormesh_from_names-1' ws_name = 'test_pcolormesh_from_names-1'
AnalysisDataService.Instance().addOrReplace(ws_name, self._test_ws) AnalysisDataService.Instance().addOrReplace(ws_name, self._test_ws)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment