Showing posts with label matplotlib. Show all posts
Showing posts with label matplotlib. Show all posts

matplotlib basics 2

 import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
x=np.linspace(0,5,11)
y=x**2

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.plot(x,y)
ax.set_title('Title')

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.plot(x,y,color='#FF8c00',linewidth=1,alpha=0.5,linestyle='--',marker='o',markersize=5) #rgb hex code and alha is transparency

matplotlib basics 1

import matplotlib.pyplot as plt
%matplotlib inline
plt.plot([3,7,8],[5,2,9],label="FirstLine")
plt.plot([2,5,7],[3,5,1],label="Second Line")
plt.xlabel('X-label sample')
plt.ylabel('Y-label sample')
plt.title('Interesting Graph\nCheckit out')
plt.legend()
plt.show()