def testLine(self): # plot a a horizontal line from myPlots.plots import linePlot # select slice if self.dataset == 'lm': tSlice = {'time': (0, 15 * 86400), 'lon': 0, 'lat': 55, 'z': 0} ySlice = {'time': 9 * 86400, 'lon': 0, 'lat': (25, 75), 'z': 10e3} elif self.dataset == 'ifs': tSlice = {'time': (3, 14), 'lon': 0, 'lat': 45, 'eta': 91} ySlice = {'time': 3.5, 'lon': 5, 'lat': (25, 75), 'eta': 60} ## line plot example # select some options kwargs = {} kwargs['clevs'] = [None, None, None, None] # data plot limits / (0,7,7) kwargs['labels'] = [ 'T, meridional', 'T, time-series', 'u, meridional', 'u, time-series' ] # for legend / [ , ] kwargs['legends'] = [1, 3, 2, 4] # location; can also be kwargs / # plot f = linePlot([[self.data.T], [self.data.u]], [ySlice, tSlice], axis=None, transpose=True, **kwargs) show()
def testProfile(self): # plot a profile from myPlots.plots import linePlot # select slice if self.dataset == 'lm': slice1 = {'time':8*86400, 'lon':0,'lat':55,'z':(0,20e3)} slice2 = {'time':9*86400, 'lon':0,'lat':55,'z':(0,20e3)} zAxis = self.data.z elif self.dataset == 'ifs': slice1 = {'time':3.5, 'lon':0,'lat':45,'eta':(30,91)} slice2 = {'time':3.5, 'lon':5,'lat':55,'eta':(30,91)} zAxis = self.data.phi ## first example # select some options kwargs = {} kwargs['clevs'] = [None, None, (150,450,10), None] # data plot limits / (0,7,7) kwargs['labels'] = [None, '', ['Temperature', 'Pot. Temp.'], 'Pressure Profile'] # for legend / [ , ] kwargs['legends'] = [4, 3, 4, 1] # location; can also be kwargs / # plot # f1 = linePlot([[self.data.T, self.data.th], [self.data.p]], [slice1, slice2], axis=zAxis, **kwargs) ## second example # select some options kwargs = {} kwargs['clevs'] = [None, None] # data plot limits / (0,7,7) kwargs['labels'] = [None, ['Day 8', 'Day 9']] # for legend / [ , ] kwargs['legends'] = [3, 1] # location; can also be kwargs / # make new axis pAxis = self.data.p; pAxis.plotatts['plotorder'] = -1; pAxis.plotatts['plotscale'] = 'log' # plot f2 = linePlot([[self.data.T], [self.data.p]], [[slice1, slice2]], axis=[[pAxis],[pAxis]], **kwargs) show()
def testLine(self): # plot a a horizontal line from myPlots.plots import linePlot # select slice if self.dataset == 'lm': tSlice = {'time':(0,15*86400),'lon':0,'lat':55,'z':0} ySlice = {'time':9*86400, 'lon':0,'lat':(25,75),'z':10e3} elif self.dataset == 'ifs': tSlice = {'time':(3,14), 'lon':0,'lat':45,'eta':91} ySlice = {'time':3.5, 'lon':5,'lat':(25,75),'eta':60} ## line plot example # select some options kwargs = {} kwargs['clevs'] = [None, None, None, None] # data plot limits / (0,7,7) kwargs['labels'] = ['T, meridional', 'T, time-series', 'u, meridional', 'u, time-series'] # for legend / [ , ] kwargs['legends'] = [1, 3, 2, 4] # location; can also be kwargs / # plot f = linePlot([[self.data.T], [self.data.u]], [ySlice, tSlice], axis=None, transpose=True, **kwargs) show()