source: trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py @ 960

Last change on this file since 960 was 960, checked in by aslmd, 12 years ago

UTIL PYTHON planetoplot_v2. MAJOR: created an easy way to load a variable from a netcdf file, see easy_get_field.py [note: now to avoid confusion with .f attributes containing field, .f() method is named .func()] ; MINOR: generic units keyword, quiet mode, dummy xy axis when not given in ppplot, bug fixes for one-value 0D requests.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#! /usr/bin/env python
2from ppclass import pp
3
4tsurf = pp()
5tsurf.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"
6tsurf.var = "tsurf"
7tsurf.x = None
8tsurf.y = 10.
9tsurf.t = 2.
10tsurf.getdefineplot()
11
12ps = pp()
13ps << tsurf
14ps.var = "ps"
15ps.getdefineplot()
16
17S = ps.func(tsurf)
18S.p[0].lstyle=""
19S.p[0].marker="h"
20S.p[0].color="g"
21S.makeplot()
22
23icetot = pp()
24icetot << tsurf
25icetot.var = "icetot"
26icetot.getdefineplot()
27
28S2 = icetot.func(tsurf)
29S2.p[0].lstyle=""
30S2.p[0].marker="D"
31S2.p[0].color="r"
32S2.makeplot()
33
34u = pp()
35u << tsurf
36u.var = "u"
37u.z = 1.
38u.get()
39
40v = pp()
41v << u
42v.var = "v"
43v.get()
44
45wind = u**2 + v**2
46wind = wind**0.5
47S3 = wind.func(ps)
48S3.p[0].lstyle=""
49S3.p[0].marker="o"
50S3.p[0].color="k"
51S3.p[0].ylabel="wind speed $\sqrt{u^{2}+v^{2}}$ (m s$^{-1}$)"
52S3.filename="scatter"
53S3.makeplot()
54
55## multidim scatter also possible
56## the important thing is forcedimplot
57
58tsurf = pp()
59tsurf.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"
60tsurf.var = "tsurf"
61tsurf.x = None
62tsurf.y = None
63tsurf.t = 2.
64tsurf.forcedimplot = 1
65tsurf.getdefineplot()
66
67ps = pp()
68ps << tsurf
69ps.var = "ps"
70ps.getdefineplot()
71
72S = ps.func(tsurf)
73S.p[0].lstyle=""
74S.p[0].marker="h"
75S.p[0].color="g"
76S.makeplot()
Note: See TracBrowser for help on using the repository browser.