source: trunk/UTIL/PYTHON/planetoplot_v2/examples/ppplot/plot_sounding.py @ 1052

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

planetoplot. added an example to use ppplot to plot a sounding very easily.

  • Property svn:executable set to *
File size: 602 bytes
Line 
1#! /usr/bin/env python
2import ppplot
3import numpy as np
4
5# load data
6# http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html
7p,z,t,dew,hum,mix,wdir,wknot,thta,thte,thtv \
8    = np.loadtxt("sounding.txt",skiprows=8,unpack=True)
9
10# make a simple plot
11sdg = ppplot.plot1d()
12sdg.f = z
13sdg.x = t
14sdg.makeshow()
15
16# Tweaking a little bit the plot
17sdg.linestyle = '-'
18sdg.marker = '.'
19sdg.color = 'r'
20sdg.ycoeff = 1.e-3
21sdg.title = "A random terrestrial sounding"
22sdg.legend = "Fort Smith 00Z 26 Sep 2013"
23sdg.xlabel = "Temperature ($^{\circ}$C)"
24sdg.ylabel = "Altitude (km)"
25sdg.makeshow()
26
27
Note: See TracBrowser for help on using the repository browser.