source: trunk/UTIL/PYTHON/planetoplot_v2/examples/simple.py @ 923

Last change on this file since 923 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: 903 bytes
Line 
1#! /usr/bin/env python
2from ppclass import pp
3
4# we define a "planetoplot" object
5u = pp()
6
7# we define its attributes
8u.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"
9u.var = "u"
10u.t = "0.5" #NB: also works without quotes
11u.z = "10" #NB: also works without quotes
12
13# we get data
14u.get()
15
16## we smooth the field a little bit
17#u.smooth(15)
18
19# we define the plot, then set a few personal stuff
20u.defineplot() 
21u.p[0].title = "This is what we name $u$ (m s$^{-1}$)"
22u.p[0].proj = "robin"
23u.filename = "simple"
24
25# we plot
26u.makeplot()
27
28# we simply change the colorbar
29# ... no need to reload data
30u.p[0].colorb = "RdBu"
31u.filename = "myplot"
32u.makeplot()
33
34# we remove map projection
35# ... idem, no need to reload data
36# ... but have to redefine plot
37u.noproj = True
38u.defineplot()
39u.makeplot()
40
41# we multiply the field by two
42# ... and redefine+remake the plot
43u = u * 2.
44u.defineplot()
45u.makeplot()
Note: See TracBrowser for help on using the repository browser.