I would suggest a few things, like variable naming style consistency or the 
unused file that you open and close. You also have an unused lw variable, and 
does dpi really need to be a variable? Its only used once, why not hard code it.

But the main thing I suggest, is posting the 'complete' traceback, so we can 
see what caused the error. I'm gonna take a wild guess at it being the 
pyplot.plot call though, due to the data types that its moaning about.

Bodsda 
Sent from my BlackBerry® wireless device

-----Original Message-----
From: stm atoc <[email protected]>
Sender: [email protected]
Date: Sat, 17 Dec 2011 21:30:17 
To: tutor<[email protected]>
Subject: [Tutor] unsupported operand

Hi there,

I would like to define concentration array based on time and then plot it.
Here is the profile:

from pylab import *
import numpy
import array
import math
tmax=1*3600
t      = 1.
outfile=open('ourtest_out.list','w')
N = 100
Conc1 = arange([0, tmax])
outfile.close()

lw = 2.0 #linewidth
dpi = 96
figure(figsize=(12,6),dpi=dpi)
pyplot.plot(Conc1, t,'r-',label='Conc' )
savefig('Conc.png')
show()

and this is the error that I got:

TypeError: unsupported operand type(s) for -: 'list' and 'int'

What would you suggest?
Thank you,
Sue
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to