[Tutor] changing coordinate
stm atoc
stm.at.oc at googlemail.com
Wed Jan 11 11:08:55 CET 2012
Hi:
I am trying to define a new coordinate for My plot.
I have a plot x axis is Concentration, Y axis, depth or Z.
Z= -1000 um.
and I would like to see the the trend and plot of concentration up to
-300 um and see how the plot changed according to the depth. So, my
main question is about how to change the coordinate based on 0 to
-300.
This is the relevant description:
# coding: utf-8
from pylab import *
import numpy
import matplotlib.pyplot as pyplot
import matplotlib.mlab as mlab
#t=3600
N = 100
dz = 1.0
h_s=-300
with open("ourtest_out.list", "r") as f:
z = numpy.array([float(v) for v in f.readline().split()[1:]])
z == z + h_s
a = numpy.loadtxt("ourtest_out.list", skiprows=3)
t=a[:,0]
nu = a[0:,1:N+1]
Conc = a[0:, N+1:]
lw = 2.0 #linewidth
dpi = 96
figure(figsize=(12,6),dpi=dpi)
pyplot.plot(Conc[1], z,'r-')
pyplot.xlabel('$Conc, mmol C m^3$')
pyplot.ylabel('$Hsml, micrometer$')
pyplot.grid(True)
legend()
savefig('Conc.png')
show()
lw = 2.0 #linewidth
dpi = 96
figure(figsize=(12,6),dpi=dpi)
semilogx(Conc[1], z,'r-')
pyplot.xlabel('$Conc, mmol C m^3$')
pyplot.ylabel('$Hsml, micrometer$')
pyplot.grid(True)
legend()
savefig('semiConc.png')
show()
lw = 2.0 #linewidth
dpi = 96
figure(figsize=(12,6),dpi=dpi)
semilogx(nu[1], z,'r-')
pyplot.xlabel('$nu, m^2/s^{-1}$')
pyplot.ylabel('$Hsml, micrometer$')
pyplot.grid(True)
legend()
savefig('nu.png')
show()
--------------
I do appreciate any help and advice.
Thanks,Sue
More information about the Tutor
mailing list