Python Forum
Multiple Plotting in Same PLot - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Multiple Plotting in Same PLot (/thread-33349.html)



Multiple Plotting in Same PLot - quest - Apr-18-2021

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?