/ Python And R Data science skills: 69 MatPlot Lib part01

Friday 16 February 2018

69 MatPlot Lib part01

https://vlrtraining.com/courses/python-data-science-beginner-tutorial 69 MatPlot Lib part01

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

In [19]:
import matplotlib.pyplot as plt
In [20]:
import numpy as np
In [32]:
x=np.linspace(1,6,10             )
In [36]:
%matplotlib inline
In [38]:
x
Out[38]:
array([ 1.        ,  1.55555556,  2.11111111,  2.66666667,  3.22222222,
        3.77777778,  4.33333333,  4.88888889,  5.44444444,  6.        ])
In [39]:
y
Out[39]:
array([  1.        ,   2.41975309,   4.45679012,   7.11111111,
        10.38271605,  14.27160494,  18.77777778,  23.90123457,
        29.64197531,  36.        ])
In [41]:
plt.plot(x,y,"r")
Out[41]:
[<matplotlib.lines.Line2D at 0xa510b00>]
In [43]:
plt.plot(x, y, 'G')
Out[43]:
[<matplotlib.lines.Line2D at 0xa5c1b00>]
In [4]:
%matplotlib inline
In [45]:
plt.xlabel('X Axis Title Here')
plt.ylabel('Y Axis Title Here')
plt.title('String Title Here')
Out[45]:
Text(0.5,1,'String Title Here')
In [44]:
plt.xlabel(" my marks")
Out[44]:
Text(0.5,0,' my marks')
In [ ]:
pl

No comments:

Post a Comment