Python Forum

Full Version: Multiple Plotting in Same PLot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I want to plot multiple curve in sale plot line here:
[Image: matplotlib-examples-displaying-and-configuring-legend]
example

My x and y values are depend on another third variable.
  number_of_result = []
  step= []
  queuesize=[]
  for j in range(5,200,5): #here is my third value
   for i in range(300):  here is my x values
    ....
    number_of_result.append(len(result2))  #here is my y values
    step.append(i)  #here is my x values
    print(result2, len(result2))
   
   queuesize.append(j) 
  plt.plot(step,number_of_result,label='Tmax= %d'% Tmax)   
  plt.xlabel(" life time(s)")
  plt.ylabel("number of result")
I could not give legend and I could not give different color to my curves. So my output image is here:
[Image: 68JgJD5]
image
It seems very confusing. How can I make it more readable, how can I give it legends for each curve and how can I give curves colors?