<jupyter_start><jupyter_text>Bar Graph<jupyter_code>x=np.array([10,60,6,45,50,90,1])
y=np.array([1,2,3,4,5,6,7])
z=np.array(["green","brown",'black',"red","yellow","orange","blue"])
plt.bar(x,y)
plt.show()
x=np.array([10,60,6,45,50,90,1])
y=np.array([1,2,3,4,5,6,7])
z=np.array(["green","brown",'black',"red","yellow","orange","blue"])
plt.bar(y,x)
plt.show()
x=np.array(["A","B",'C',"D","E","F","G"])
y=np.array([1,2,3,4,5,6,7])
plt.bar(x,y)
plt.show()
#bars on horizontal line
x=np.array(["A","B",'C',"D","E","F","G"])
y=np.array([1,2,3,4,5,6,7])
plt.barh(x,y)
plt.show()
#changing the color of bars
x=np.array(["A","B",'C',"D","E","F","G"])   #independent quantity
y=np.array([1,2,3,4,5,6,7])           #dependent quantity
plt.bar(x,y,color="red")
plt.show()
#width of bar
x=np.array(["A","B",'C',"D","E","F","G"])
y=np.array([1,2,3,4,5,6,7])
plt.bar(x,y,color="red",width=0.3)
plt.show()
x=np.array(["A","B",'C',"D","E","F","G"])
y=np.array([1,2,3,4,5,6,7])
plt.barh(x,y,height=0.3,color="g")
plt.show()<jupyter_output><empty_output><jupyter_text>Histogram<jupyter_code>x=np.random.normal(170,10,500)
plt.grid()
plt.hist(x) #only one parameter
plt.show()<jupyter_output><empty_output><jupyter_text>Pie charts<jupyter_code>x=np.array([25,25,15,35])
plt.pie(x)
plt.show()
x=np.array([25,25,15,35])
y=["apple","mango","gauva","pier"]
plt.pie(x,labels=y)
plt.show()
#changing the start angle
x=np.array([25,25,15,35])
y=["apple","mango","gauva","pier"]
plt.pie(x,labels=y,startangle=90)
plt.show()
#separate the sectors in pie chart
x=np.array([25,25,15,35])
y=["apple","mango","gauva","pier"]
z=[0.2,0.3,0.1,0.1]
plt.pie(x,labels=y,startangle=90,explode=z)
plt.show()
#3D view
x=np.array([25,25,15,35])
y=["apple","mango","gauva","pier"]
z=[0.2,0.3,0.1,0.1]
plt.pie(x,labels=y,startangle=90,explode=z,shadow=True)
plt.show()
#to display small box of information
x=np.array([25,25,15,35])
y=["apple","mango","gauva","pier"]
z=[0.2,0.3,0.1,0.1]
plt.pie(x,labels=y,startangle=90,explode=z,shadow=True)
plt.legend()
plt.show()
#percentage 
x=np.array([25,25,20,30])
y=["apple","mango","gauva","pier"]
z=[0.2,0.3,0.1,0.1]
plt.pie(x,labels=y,startangle=90,explode=z,shadow=True)
plt.legend()
plt.show()
#We can use this method to see limit of x and y axis
xmin,xmax=plt.xlim()
ymin,ymax=plt.ylim()
print(xmin,xmax,ymin,ymax)
#We can change the scaling factor of x and y axis
sf=0.15
plt.xlim(xmin*sf,xmax*sf)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.29017673653925197, 'fraction_numerical': 0.07685984381422113, 'mean_word_length': 9.722466960352422, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '328359', 'license': 'Apache-2.0', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1209, 'n_words': 134, 'path': 'Module 3/Matplotlib.ipynb', 'repo_name': 'KRITGYA2001/Data-Science-with-Python', 'size': '2433'}