def test_HstackTimeSeries_inconsistent_data_geometries(self): HT = HstackTimeseries() x = np.random.random(100)*2.-1. y = np.random.random(1000)*2.-1. HT.add_data(x, 'A') with self.assertRaises(ValueError): HT.add_data(y, 'B')
def test_HstackTimeSeries_inconsistent_data_geometries(self): HT = HstackTimeseries() x = np.random.random(100) * 2. - 1. y = np.random.random(1000) * 2. - 1. HT.add_data(x, 'A') with self.assertRaises(ValueError): HT.add_data(y, 'B')
def test_HstackTimeSeries(self): HT = HstackTimeseries() for i in xrange(15): x = np.random.random(100) * 2. - 1. HT.add_data(x, 'model' + str(i).zfill(3)) HT.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle')
def test_HstackTimeSeries_noplotdone(self): HT = HstackTimeseries() with self.assertRaises(ValueError): HT._add_colorbar()
def test_HstackTimeSeries_monthly_ticks(self): HT = HstackTimeseries() f = plt.figure() ax = f.add_subplot(111) ax.plot(np.arange(12)) HT._set_monthly_xtick_labels(ax)
def test_HstackTimeSeries_duplicate_keys(self): HT = HstackTimeseries() x = np.random.random(100) * 2. - 1. HT.add_data(x, 'A') with self.assertRaises(ValueError): HT.add_data(x, 'A')
def test_HstackTimeSeries_invalidData(self): HT = HstackTimeseries() x = np.random.random((50, 60)) * 2. - 1. with self.assertRaises(ValueError): HT.add_data(x, 'test')
def test_HstackTimeSeries_duplicate_keys(self): HT = HstackTimeseries() x = np.random.random(100)*2.-1. HT.add_data(x, 'A') with self.assertRaises(ValueError): HT.add_data(x, 'A')
def test_HstackTimeSeries_invalidData(self): HT = HstackTimeseries() x = np.random.random((50, 60))*2.-1. with self.assertRaises(ValueError): HT.add_data(x, 'test' )
def test_HstackTimeSeries(self): HT = HstackTimeseries() for i in xrange(15): x = np.random.random(100)*2.-1. HT.add_data(x, 'model' + str(i).zfill(3) ) HT.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle')
""" This file is part of pyCMBS. (c) 2012-2014 For COPYING and LICENSE details, please refer to the file COPYRIGHT.md """ """ Hstackplotting """ from pycmbs.plots import HstackTimeseries import numpy as np import matplotlib.pyplot as plt plt.close('all') ht = HstackTimeseries() for i in xrange(50): x = np.random.random(12) * 2. - 1. ht.add_data(x, 'model' + str(i).zfill(3)) ht.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle', maxheight=0.3, monthly_clim_ticks=True) plt.show()
This file is part of pyCMBS. (c) 2012-2014 For COPYING and LICENSE details, please refer to the file COPYRIGHT.md """ """ Hstackplotting """ from pycmbs.plots import HstackTimeseries import numpy as np import matplotlib.pyplot as plt plt.close('all') ht = HstackTimeseries() for i in xrange(50): x = np.random.random(12)*2.-1. ht.add_data(x, 'model' + str(i).zfill(3) ) ht.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle', maxheight=0.3, monthly_clim_ticks=True) plt.show() #~ set_size_inches(18.5,10.5)