Пример #1
0
# read data
#~ D = Data('./example_data/air.mon.mean.nc', 'air',read=True)
D = download.get_sample_file(name='air')
D.label = 'air temperature'

#~ P = Data('./example_data/pr_wtr.eatm.mon.mean.nc','pr_wtr',read=True)
P = download.get_sample_file(name='rain')

# some analysis
print 'Temporal stdv. ...'
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)
Пример #2
0
 def test_LinePlot_WithAxis(self):
     x = self.D
     f = plt.figure()
     ax = f.add_subplot(111)
     L = LinePlot(ax=ax)
     L.plot(x)
Пример #3
0
 def test_LinePlot_General(self):
     x = self.D
     L = LinePlot()
     L1 = LinePlot(regress=True)
     L.plot(x)
     L1.plot(x)
Пример #4
0
 def test_LinePlot_WithAxis(self):
     x = self.D
     f = plt.figure()
     ax = f.add_subplot(111)
     L = LinePlot(ax=ax)
     L.plot(x)
Пример #5
0
 def test_LinePlot_General(self):
     x = self.D
     L = LinePlot()
     L1 = LinePlot(regress=True)
     L.plot(x)
     L1.plot(x)
# read data
#~ D = Data('./example_data/air.mon.mean.nc', 'air',read=True)
D = download.get_sample_file(name='air')
D.label = 'air temperature'

#~ P = Data('./example_data/pr_wtr.eatm.mon.mean.nc','pr_wtr',read=True)
P = download.get_sample_file(name='rain')

# some analysis
print 'Temporal stdv. ...'
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 ...'