Hi again,
This is slightly similar to my previous post, however using lists, not
dictionaires.
So, I have a for loop that produces two list, as follows:
Hours = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12',
'13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
and
Values = ['5.8', '5.76', '5.81', '5.72', '5.69', '5.88', '5.77', '5.64',
'6.78', '5.82', '6.74', '5.45', '5.61', '5.77', '10.02', '5.88', '5.77',
'5.64', '6.78', '5.82', '6.74', '5.45', '5.61']
So as you can see for each hour a value is given, now plotting this is
simple, its just plot(Hours, Values).
However, this is generated from a for loop and there could be anything from
1 to 1000 of the "Hours" and "Values" lists (The "Hours" list is always the
same), and I would like to plot all on the same axis.
Is there a way to build a "plot string", and then plot the string once the
for loop has finished. i.e
PlotString = ""
for item in AList:
Hours = item[0]
Values = item[1]
PlotString += Hours, Values
plot(PlotString)
Now I know the above does not work, but it is purely to describe where I am
trying to go.
Thank you for all your help.
···
–
View this message in context: http://www.nabble.com/Plot-Multiple-List-by-concatenating-to-a-string--tp18751780p18751780.html
Sent from the matplotlib - users mailing list archive at Nabble.com.