Plotting some variables in python
4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.
Start file
def Plot_All(): plt.plot(x1,y1,color='k',lw=0.8,label="line #1") plt.plot(x1,y1,color='k',lw=0.8,label="line #1") plt.plot(x1,y1,color='k',lw=0.8,label="line #1") plt.plot(x1,y1,color='k',lw=0.8,label="line #1")
End file
def Plot_All(): plt.plot(x1,abs(y1),color='k',lw=0.8,label="line #1") plt.plot(x2,abs(y2),color='b',lw=0.8,label="line #2") plt.plot(x3,abs(y3),color='r',lw=0.8,label="line #3") plt.plot(x4,abs(y4),color='g',lw=0.8,label="line #4")
View Diff
2,5c2,5 < plt.plot(x1,y1,color='k',lw=0.8,label="line #1") < plt.plot(x1,y1,color='k',lw=0.8,label="line #1") < plt.plot(x1,y1,color='k',lw=0.8,label="line #1") < plt.plot(x1,y1,color='k',lw=0.8,label="line #1") --- > plt.plot(x1,abs(y1),color='k',lw=0.8,label="line #1") > plt.plot(x2,abs(y2),color='b',lw=0.8,label="line #2") > plt.plot(x3,abs(y3),color='r',lw=0.8,label="line #3") > plt.plot(x4,abs(y4),color='g',lw=0.8,label="line #4")
Solutions by @vionwinnie:
Unlock 6 remaining solutions by signing in and submitting your own entry