[Tutor] New plot over the old graph

stm atoc stm.at.oc at googlemail.com
Thu Dec 1 14:30:15 CET 2011


Hi there,

I would like to make a new plot with new data over the old one (with
old/first data) in the same condition (shape, dimensions....) for
comparison and analysis data.

With your help, I have a good script from the previous discussion:


**********
from pylab import *
import numpy
import matplotlib.pyplot as pyplot
import matplotlib.mlab as mlab

with open("ourtest_out.list", "r") as f:
   z = numpy.array([float(v) for v in f.readline().split()[1:]])

a = numpy.loadtxt("ourtest_out.list", skiprows=3)
N = 100
Conc = a[0:, N+1:]
print len(Conc[0]) == len(z)

figure()

pyplot.plot(Conc[0],z,'r-',label='initial')
pyplot.plot(Conc[1],z,'b-',label='after 20s')

show()
*********

I have tried to make subplot for this case as follows:

pyplot.subplot(111)
pyplot.plot(Conc[0],z,'r-',label='initial')
pyplot.plot(Conc[1],z,'b-',label='after 20s')

However, I am not sure how to add new data over this to make a graph
including both new and old data simultaneously.

I do appreciate for any advice.

Thank you,
Sue


More information about the Tutor mailing list