Basic Python

scipy, numpy, pylab

Example:

density.png

   1 from pylab import *
   2 # The seawater module is installed only for Python2.6.2
   3 # module load Python/2.6.2 
   4 import seawater
   5 
   6 S=linspace(0,35)
   7 T=linspace(-2,35.0)
   8 
   9 rho=zeros((S.size,T.size))
  10 
  11 for i,t in enumerate(T):
  12     rho[i,:]=seawater.dens(S,t)
  13 
  14 figure()
  15 CS = contour(S,T,rho,15,colors='k')
  16 clabel(CS, fontsize=8, inline=1)
  17 ylabel('Temperature [$^\circ$C]')
  18 xlabel('Salinity')
  19 title('Sea water density  [kg/m$^3$]')
  20 show()
  21 savefig('density.png',dpi=75)