def test_ScatterPlot_InvalidShape(self): x = self.D S = ScatterPlot(x) y = self.D.copy() y.data = np.random.random((10, 20, 30, 40)) with self.assertRaises(ValueError): S.plot(y, fldmean=False)
def test_ScatterPlot_InvalidShape(self): x = self.D S = ScatterPlot(x) y = self.D.copy() y.data = np.random.random((10,20,30,40)) with self.assertRaises(ValueError): S.plot(y, fldmean=False)
t = D.timstd(return_object=True) map_plot(t,use_basemap=True,title='Temporal stdv.',show_stat=True) print 'Some LinePlot' L=LinePlot(regress=True, title='This is a LinePlot with regression') L.plot(D, label='2m air temperature') L.plot(P, label='Precipitable water', ax=L.ax.twinx(), color='green') # use secondary axis for plotting here L.legend() print 'Scatterplot between different variables ...' #here we just generate some random second variable D1 = D.copy() D1.data += np.random.random(D.shape)*50. S=ScatterPlot(D) # scatterplot is initialized with definition of X-axis object S.plot(D1) S.legend() print 'Temporal trend ...' f=plt.figure() ax1=f.add_subplot(221) ax2=f.add_subplot(222) ax3=f.add_subplot(223) ax4=f.add_subplot(224) R,S,I,P = D.temporal_trend(return_object=True) map_plot(R, use_basemap=True, ax=ax1) map_plot(S, use_basemap=True, ax=ax2) map_plot(I, use_basemap=True, ax=ax3) map_plot(P, use_basemap=True, ax=ax4) f.suptitle('Example of temporal correlation analysis results', size=20)
def test_ScatterPlot_FldemeanFalse(self): x = self.D S = ScatterPlot(x) S.plot(x, fldmean=False) S.legend()
def test_ScatterPlot_GeneralWithNormalization(self): x = self.D S = ScatterPlot(x, normalize_data=True) S.plot(x) S.legend()
def test_ScatterPlot_General(self): x = self.D S = ScatterPlot(x) S.plot(x) S.legend()
print 'Map difference between datasets ...' map_difference(D,P) print 'ZonalPlot ...' Z=ZonalPlot() Z.plot(D) print 'Some LinePlot' L=LinePlot(regress=True, title='This is a LinePlot with regression') L.plot(D, label='2m air temperature') L.plot(P, label='Precipitable water', ax=L.ax.twinx(), color='green') # use secondary axis for plotting here L.legend() print 'Scatterplot between different variables ...' S=ScatterPlot(D) # scatterplot is initialized with definition of X-axis object S.plot(P) S.legend() print 'Hovmoeller diagrams ...' hm = HovmoellerPlot(D) hm.plot(climits=[-20.,30.]) print '... generate Hovmoeller plot from deseasonalized anomalies' ha=HovmoellerPlot(D.get_deseasonalized_anomaly(base='all')) ha.plot(climits=[-2.,2.], cmap='RdBu_r') plt.show() r=raw_input("Press Enter to continue...") plt.close('all')
map_plot(t, use_basemap=True, title='Temporal stdv.', show_stat=True) print 'Some LinePlot' L = LinePlot(regress=True, title='This is a LinePlot with regression') L.plot(D, label='2m air temperature') L.plot(P, label='Precipitable water', ax=L.ax.twinx(), color='green') # use secondary axis for plotting here L.legend() print 'Scatterplot between different variables ...' #here we just generate some random second variable D1 = D.copy() D1.data += np.random.random(D.shape) * 50. S = ScatterPlot( D) # scatterplot is initialized with definition of X-axis object S.plot(D1) S.legend() print 'Temporal trend ...' f = plt.figure() ax1 = f.add_subplot(221) ax2 = f.add_subplot(222) ax3 = f.add_subplot(223) ax4 = f.add_subplot(224) R, S, I, P = D.temporal_trend(return_object=True) map_plot(R, use_basemap=True, ax=ax1) map_plot(S, use_basemap=True, ax=ax2) map_plot(I, use_basemap=True, ax=ax3) map_plot(P, use_basemap=True, ax=ax4) f.suptitle('Example of temporal correlation analysis results', size=20)