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

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

UTIL PYTHON planetoplot_v2

PPCLASS AND PPPLOT

  • added global plot settings in pp() objects
  • self is returned for each method to allow e.g. one-line get + attribution
  • added labeling of 1D plots
  • fine-tuning of plot appearance (e.g. vector key)
  • corrected a problem with plotin (same object can be referred to all along)
  • fixed meanarea for 1D requests

PP.PY

  • no more -f for pp.py (files are simply given as arguments!)
  • added missing options to pp.py
  • nice informative header

PP_RELOAD.PY

  • pp_reload.py can now change colorbars and 1D markers

EXAMPLES

  • general update of examples + few additions
  • added a nice example tide with mixed 2D+1D plots
  • 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.f(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.f(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.f(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.f(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.