From ce7cfde3fc8db5a676418f24ac5ff4873f5277ea Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Fri, 20 Jul 2018 17:49:46 -0700 Subject: [PATCH] almost there --- tests/test_vcs_isofill_gap.py | 10 ++++++++++ tests/test_vcs_isoline_gap.py | 10 ++++++++++ vcs/Canvas.py | 14 +++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/test_vcs_isofill_gap.py create mode 100644 tests/test_vcs_isoline_gap.py diff --git a/tests/test_vcs_isofill_gap.py b/tests/test_vcs_isofill_gap.py new file mode 100644 index 000000000..fc431c590 --- /dev/null +++ b/tests/test_vcs_isofill_gap.py @@ -0,0 +1,10 @@ +import basevcstest + +class TestVCSIsofill(basevcstest.VCSBaseTest): + + def testIsofillLevels(self): + data = self.clt("clt") + iso = self.x.createisofill() + iso.projection = 'polar' + self.x.plot(data,iso) + self.checkImage("test_vcs_isofill_gap.png") diff --git a/tests/test_vcs_isoline_gap.py b/tests/test_vcs_isoline_gap.py new file mode 100644 index 000000000..55bfe2767 --- /dev/null +++ b/tests/test_vcs_isoline_gap.py @@ -0,0 +1,10 @@ +import basevcstest + +class TestVCSIsofill(basevcstest.VCSBaseTest): + + def testIsofillLevels(self): + data = self.clt("clt") + iso = self.x.createisoline() + iso.projection = 'polar' + self.x.plot(data,iso) + self.checkImage("test_vcs_isoline_gap.png") diff --git a/vcs/Canvas.py b/vcs/Canvas.py index 183a1e2cd..9d34aaa2a 100644 --- a/vcs/Canvas.py +++ b/vcs/Canvas.py @@ -3794,11 +3794,23 @@ def __plot(self, arglist, keyargs): if p.type in no_deformation_projections and ( doratio == "0" or doratio[:4] == "auto"): doratio = "1t" + if arglist[3] in ["boxfill", "isofill", "isoline"]: + if numpy.allclose(copy_mthd.datawc_x1, 1.e20) and numpy.allclose(copy_mthd.datawc_x2, 1.e20): + axis = arglist[0].getAxis(-1) + amn, amx = vcs.minmax(axis) + print("ORIGINAL:",amn, amx) + bnds = axis.getBounds() + mn, mx = vcs.minmax(bnds) + if numpy.allclose(mx - mn, axis.modulo): + arglist[0] = arglist[0](**{axis.id: (mn, mx, "ooe")}) + print("NEW MX MN:",vcs.minmax(arglist[0].getAxis(-1))) + copy_mthd.datawc_x1 = amn + copy_mthd.datawc_x2 = amx for keyarg in list(keyargs.keys()): if keyarg not in self.__class__._plot_keywords_ + self.backend._plot_keywords: if keyarg in self.__class__._deprecated_plot_keywords_: warnings.warn("Deprecation Warning: Keyword '%s' will be removed in the next version" - "of UV-CDAT." % keyarg, vcs.VCSDeprecationWarning) + "of CDAT." % keyarg, vcs.VCSDeprecationWarning) else: warnings.warn( 'Unrecognized vcs plot keyword: %s, assuming backend (%s) keyword' %