source: trunk/UTIL/PYTHON/planetoplot_v2/examples/windspeed.py @ 931

Last change on this file since 931 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: 886 bytes
Line 
1#! /usr/bin/env python
2from ppclass import pp
3
4u = pp()
5u.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"
6u.var = "u"
7u.t = "0.5,0.8"
8u.z = "10,20"
9u.getdefineplot(extraplot=2) # prepare 2 extraplots (do not show)
10u.p[0].proj = "ortho"
11u.p[0].title = "$u$ (m s$^{-1}$)"
12u.makeplot()
13
14v = pp()
15v << u  # NB: initialize v object with u object's attributes
16v.var = "v"
17v.get()
18v.plotin = u # plotin must be defined before .defineplot()
19v.defineplot()
20v.p[1].proj = "ortho"
21v.p[1].title = "$v$ (m s$^{-1}$)"
22v.makeplot() # plot within the previous one (do not show)
23
24wind = u**2 + v**2
25wind = wind**0.5
26wind.plotin = v
27wind.filename = "windspeed"
28wind.defineplot()
29wind.p[2].title = "$\sqrt{u^2+v^2}$ (m s$^{-1}$)"
30wind.p[2].proj = "ortho"
31wind.makeplot() # plot within the previous one (show because complete)
32
33
34## in this case it is not possible to make another plot afterwards...
35
Note: See TracBrowser for help on using the repository browser.