Posts

Matplot LIbrary

Image
Matplot In [1]: import matplotlib.pyplot as plt plt . plot ([ 1 , 2 , 3 , 4 ]) plt . ylabel ( 'some numbers' ) plt . show () In [2]: plt . plot ([ 1 , 2 , 3 , 4 ], [ 1 , 4 , 9 , 16 ]) Out[2]: [<matplotlib.lines.Line2D at 0x1b7a2b7fa58>] In [4]: import matplotlib.pyplot as plt plt . plot ([ 1 , 2 , 3 , 4 ], [ 1 , 4 , 9 , 16 ], 'ro' ) plt . axis ([ 0 , 6 , 0 , 20 ]) plt . show () In [5]: import numpy as np import matplotlib.pyplot as plt # evenly sampled time at 200ms intervals t = np . arange ( 0. , 5. , 0.2 ) # red dashes, blue squares and green triangles plt . plot ( t , t , 'r--' , t , t ** 2 , 'bs' , t , t ** 3 , 'g^' ) plt . show () In [9]: import numpy as n...