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
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 346 remaining solutions by signing in and submitting your own entry
#347 Calarasanu Andrei / @_fanfani4_ - Score: 181 - 06/29/21 @ 09:01
jfy<C-V>4jIabs(<Esc>[1;5C<Esc>u<Esc>w)bBBkkkwwwwwwwww)(jf,f,i)<Esc>j<C-A>bbbbbbbi<BS>2)<Esc>ji<BS>3)<Esc>ji<BS>4)<Esc>bbbbkkk<C-A>bbbb<C-A>bbbb<C-X>bbbbb<C-A>jkuj<C-A>jb<C-A><C-A>bj<C-A><C-A><C-A>$<Left><BS>4a<BS>4<Up><BS>3<Up><BS>2<Esc>:wq<Esc><Esc>k0fya<Del>1<Esc>f;'<Esc>f'ja<Del>b<Down><BS>r<Down><BS>g<Esc>:wq<Esc>2kwwww<Del>0<Esc><Esc><Esc>f.f.i0<Esc>:wq<CR>
0 comments