You are on page 1of 70

matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

LAXMAN CHAUDHARY

CENTRAL DEPARMENT OF PHYSICS

DATA HANDLING

BHURIGAUN BARDIYA

(matplotlib)

line plot
In [1]: import matplotlib.pyplot as plt

In [2]: days=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

In [3]: temperature=[27,26,25,24,29,30,25.5,17.98,20.43,19,30,27,24.79,26.76,

In [4]: plt.plot(days,temperature)
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[4]: <function matplotlib.pyplot.show(close=None, block=None)>

In [5]: plt.axis([0,20,0,32])
plt.plot(days,temperature)
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')

1 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.show
Out[5]: <function matplotlib.pyplot.show(close=None, block=None)>

In [6]: plt.plot(days,temperature,color='r',marker='o')
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[6]: <function matplotlib.pyplot.show(close=None, block=None)>

2 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [7]: plt.plot(days,temperature,color='r',marker='^')
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[7]: <function matplotlib.pyplot.show(close=None, block=None)>

In [8]: plt.plot(days,temperature,color='r',marker='o',linestyle="--")
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[8]: <function matplotlib.pyplot.show(close=None, block=None)>

3 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [9]: plt.plot(days,temperature,color='r',marker='o',linestyle="-.")
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[9]: <function matplotlib.pyplot.show(close=None, block=None)>

In [10]: plt.plot(days,temperature,color='r',marker='o',linestyle=":")
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[10]: <function matplotlib.pyplot.show(close=None, block=None)>

4 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [11]: plt.plot(days,temperature,color='r',marker='o',linestyle="--",linewidth
)
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show

Out[11]: <function matplotlib.pyplot.show(close=None, block=None)>

In [12]: plt.plot(days,temperature,color='y',marker='o',linestyle="--",linewidth
plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show()

5 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [13]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)# same as above


plt.title('ktm temperarture')
plt.xlabel('days')
plt.ylabel('temperature')
plt.show()

In [14]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.show()

6 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [15]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'])
plt.show()

In [16]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=3)
plt.show()

7 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [17]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=5)
plt.show()

In [18]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=6)
plt.show()

8 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [19]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=7)
plt.show()

In [20]: plt.plot(days,temperature,'yo--',linewidth=3,markersize=6,label='Temp line'


plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(loc=6)
plt.show()

9 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [21]: from matplotlib import style


plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=6)
plt.grid(color="r",linestyle="-",linewidth=2)
plt.show()

In [22]: from matplotlib import style


plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=6)
plt.grid(color="k",linestyle="-.",linewidth=2)
plt.show()

In [23]: from matplotlib import style


plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm temperarture',fontsize=16)

10 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=6)
plt.grid(color="k",linestyle="--",linewidth=2)
plt.show()

In [24]: from matplotlib import style


plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm temperarture',fontsize=16)
plt.xlabel('days',fontsize=16)
plt.ylabel('temperature',fontsize=16)
plt.legend(['tem line'],loc=6)
plt.grid(color="c",linestyle=":",linewidth=2)
plt.show()

In [25]: dangadhi_tem=[28.1,29.3,28.1,28.2,27.5,27.2,27.7,27.3,27.4,27,26.5,28.8
len(dangadhi_tem)

Out[25]: 16

In [26]: dangadhi_tem=[28.1,29.3,28.1,28.2,27.5,27.2,27.7,27.3,27.4,27,26.5,28.8

11 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [27]: from matplotlib import style


plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.plot(days,dangadhi_tem,'ro--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm & Dhangadhi temperarture',fontsize=16,color='g')
plt.xlabel('days',fontsize=16,color='c')
plt.ylabel('temperature',fontsize=16,color='k')
plt.legend(['tem line_for_ktm','Tem line for dhangadhi'],loc=6)
plt.grid(color="k",linestyle="-.",linewidth=2)
plt.show()

Ploting Histogram
In [28]: import random
import numpy as np

In [29]: phys_std_age=np.random.randint(18,45,(100))
chem_std_age=np.random.randint(15,40,(100))

In [30]: print(phys_std_age)
print(chem_std_age)

12 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

[41 22 20 26 37 23 28 30 44 42 30 34 40 39 26 18 20 40 37 22 37 39

In [31]: plt.hist(phys_std_age)
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

In [32]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8)
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

13 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [33]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='step')
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

In [34]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='barstacked')
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

14 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [35]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='stepfilled')
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

In [36]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='barstacked',align="left"
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

15 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [37]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='barstacked',align="right"
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

In [38]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='barstacked',align="right"
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

16 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [39]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,histtype='barstacked',align="right"
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

In [40]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,color="y",histtype='barstacked'
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.show()

17 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [41]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,color="y",histtype='barstacked'
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.show()

In [42]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,color="y",histtype='barstacked'
plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.show()

In [43]: bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,color="y",histtype='barstacked'
plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()

18 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.show()

In [44]: bins=[15,20,25,30,35,40,45]
plt.hist([phys_std_age,chem_std_age],bins,width=0.8,color=["y","m"],histtyp
#plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align="ri
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.show()

19 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [45]: plt.hist([phys_std_age,chem_std_age],bins,width=0.8,color=["y","m"],histtyp
#plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align="ri
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.show()

In [46]: plt.hist([phys_std_age,chem_std_age],bins,width=2,color=["y","m"],histtype
#plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align="ri
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.show()

20 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [47]: plt.figure(figsize=(15,8))
plt.hist([phys_std_age,chem_std_age],bins,width=2,color=["y","m"],histtype
plt.title('Student ages of physics & chemistry',fontsize=20)
plt.xlabel("Age category",fontsize=16)
plt.ylabel("No of std age",fontsize=16)
plt.legend(['Physics student','Chemeistry student'])
plt.show()

In [48]: from matplotlib import style

In [49]: style.use('ggplot')
plt.figure(figsize=(15,8))
plt.hist([phys_std_age,chem_std_age],bins,width=2,color=["y","m"],histtype
plt.title('Student ages of physics & chemistry',fontsize=20)
plt.xlabel("Age category",fontsize=16)
plt.ylabel("No of std age",fontsize=16)
plt.legend(['Physics student','Chemeistry student'])
plt.show()

21 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [50]: style.use('ggplot')
plt.figure(figsize=(15,8))
plt.hist([phys_std_age,chem_std_age],bins,width=2,color=["y","m"],histtype
plt.title('Student ages of physics & chemistry',fontsize=20)
plt.xlabel("Age category",fontsize=16)
plt.ylabel("No of std age",fontsize=16)
plt.legend(['Physics student','Chemeistry student'])
plt.grid(axis='both',color='k',linestyle='-.',linewidth=2)
plt.show()

Ploting Bar Chart


In [51]: import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style

In [52]: classes=['java','python','perl','c+','c++']
class1_std=np.random.randint(10,30,5)
class2_std=np.random.randint(5,40,5)
class3_std=np.random.randint(5,35,5)

22 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [53]: plt.bar(classes,class1_std)

Out[53]: <BarContainer object of 5 artists>

In [54]: plt.barh(classes,class1_std)

Out[54]: <BarContainer object of 5 artists>

In [55]: plt.bar(classes,class1_std,width=0.2)#width is 20%

Out[55]: <BarContainer object of 5 artists>

23 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [56]: plt.bar(classes,class1_std,width=0.2,align='edge')

Out[56]: <BarContainer object of 5 artists>

In [57]: plt.bar(classes,class1_std,width=0.8,align='edge',color='g',edgecolor

Out[57]: <BarContainer object of 5 artists>

In [58]: plt.bar(classes,class1_std,width=0.8,align='edge',color='g',edgecolor

Out[58]: <BarContainer object of 5 artists>

24 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [59]: plt.bar(classes,class1_std,width=0.8,align='edge',color='g',edgecolor

Out[59]: <BarContainer object of 5 artists>

In [60]: plt.bar(classes,class1_std,width=0.8,align='edge',color='g',edgecolor
plt.legend()

Out[60]: <matplotlib.legend.Legend at 0x7f38de8a7be0>

25 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [61]: plt.figure(figsize=(16,9))
plt.bar(classes,class1_std,width=0.5,align='edge',color='g',edgecolor
plt.legend()

Out[61]: <matplotlib.legend.Legend at 0x7f39086e6278>

In [62]: style.use('ggplot')
plt.figure(figsize=(16,9))
plt.bar(classes,class1_std,width=0.5,align='edge',color='g',edgecolor
plt.legend()

Out[62]: <matplotlib.legend.Legend at 0x7f38de8db320>

26 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [63]: plt.figure(figsize=(16,9))
plt.bar(classes,class1_std,width=0.5,align='edge',color='g',edgecolor
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.legend()

Out[63]: <matplotlib.legend.Legend at 0x7f38de675a20>

27 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [64]: plt.figure(figsize=(16,9))
plt.bar(classes,class1_std,width=0.5,align='edge',color="b",edgecolor
plt.bar(classes,class2_std,width=0.5,align='edge',color='g',edgecolor
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.legend()

Out[64]: <matplotlib.legend.Legend at 0x7f38de6f5dd8>

28 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [65]: plt.figure(figsize=(20,10))
classes_index=np.arange(len(classes))
width=0.2
plt.bar(classes_index,class1_std,align='edge',color="b",edgecolor='r'
plt.bar(classes_index+width,class2_std,align='edge',color='g',edgecolor
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.legend()

Out[65]: <matplotlib.legend.Legend at 0x7f38de2e69e8>

29 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [66]: plt.figure(figsize=(20,10))
classes_index=np.arange(len(classes))
width=0.2
plt.bar(classes_index,class1_std,align='edge',color="b",edgecolor='r'
plt.bar(classes_index+width,class2_std,align='edge',color='g',edgecolor
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.xticks(classes_index+width,classes)
plt.legend()

Out[66]: <matplotlib.legend.Legend at 0x7f38de307908>

30 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [67]: plt.figure(figsize=(20,10))
classes_index=np.arange(len(classes))
width=0.2
plt.bar(classes_index,class1_std,align='edge',color="b",edgecolor='r'
plt.bar(classes_index+width,class2_std,align='edge',color='g',edgecolor
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.xticks(classes_index+width,classes,fontsize=16,rotation=30)
plt.legend()

Out[67]: <matplotlib.legend.Legend at 0x7f38de18e6a0>

31 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [68]: plt.figure(figsize=(16,9))
classes_index=np.arange(len(classes))
width=.2
plt.bar(classes_index,class1_std,align='edge',color="b",edgecolor='r'
plt.bar(classes_index+width,class2_std,align='edge',color='g',edgecolor
plt.bar(classes_index+width+width,class3_std,align='edge',color='y',edgecol
plt.title("BAR CHART FOR ML CLASS",fontsize=20)
plt.xlabel("Classes",fontsize=20)
plt.ylabel("No of Students",fontsize=20)
plt.xticks(classes_index+width,classes,fontsize=16,rotation=30)
plt.legend()

Out[68]: <matplotlib.legend.Legend at 0x7f38de10b588>

In [69]: import pandas as pd

In [70]: df=pd.read_csv('/home//user2/Documents/ml+python/googleplaystore.csv'
df

Out[70]:
Content
App Category Rating Reviews Size Installs Type Price
Rating

Photo
Editor &
Candy
0 ART_AND_DESIGN 4.1 159 19M 10,000+ Free 0 Everyone
Camera &
Grid &
ScrapBook

Coloring
1 book ART_AND_DESIGN 3.9 967 14M 500,000+ Free 0 Everyone
moana

32 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

Content
App Category Rating Reviews Size Installs Type Price
Rating

U
Launcher
Lite –
2 FREE Live ART_AND_DESIGN 4.7 87510 8.7M 5,000,000+ Free 0 Everyone
Cool
Themes,
Hide ...

Sketch -
3 Draw & ART_AND_DESIGN 4.5 215644 25M 50,000,000+ Free 0 Teen
Paint

Pixel Draw
- Number
4 Art ART_AND_DESIGN 4.3 967 2.8M 100,000+ Free 0 Everyone
Coloring
Book

... ... ... ... ... ... ... ... ...

Varies
My Talking
995 ENTERTAINMENT 4.6 6238 with 100,000+ Paid $4.99 Everyone
Pet
device

Varies
996 Funny Pics ENTERTAINMENT 3.9 9941 with 1,000,000+ Free 0 Teen
device

Funny
997 Quotes ENTERTAINMENT 4.2 23666 3.6M 1,000,000+ Free 0 Teen
Free

In [71]: df.shape

Out[71]: (1000, 13)

In [72]: df.shape

Out[72]: (1000, 13)

In [73]: x=df['Rating']
y=df['Reviews']

33 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [74]: plt.scatter(x,y)

Out[74]: <matplotlib.collections.PathCollection at 0x7f38dc27b710>

In [76]: plt.title('google play store acatter plot')


plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y)

Out[76]: <matplotlib.collections.PathCollection at 0x7f38dc1870f0>

34 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [78]: plt.title('google play store acatter plot')


plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k')

Out[78]: <matplotlib.collections.PathCollection at 0x7f38dc098630>

In [79]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k')

Out[79]: <matplotlib.collections.PathCollection at 0x7f38dc01e080>

35 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [82]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100)

Out[82]: <matplotlib.collections.PathCollection at 0x7f38dbce0588>

In [83]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100,alpha=.5)

Out[83]: <matplotlib.collections.PathCollection at 0x7f38dbc61f98>

In [85]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')

36 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100,alpha=.5,linewidth=5)
Out[85]: <matplotlib.collections.PathCollection at 0x7f38dbb73358>

In [87]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100,alpha=.5,linewidth=2,edgecolor

Out[87]: <matplotlib.collections.PathCollection at 0x7f38dba71780>

37 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [89]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100,alpha=.5,linewidth=2,edgecolor

Out[89]: <matplotlib.collections.PathCollection at 0x7f38db9139e8>

In [90]: plt.figure(figsize=(16,9))
plt.title('google play store acatter plot')
plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=100,alpha=.5,linewidth=2,edgecolor
plt.scatter(x,df['Installs'],c='g',marker="o",s=100,alpha=.5,linewidth

Out[90]: <matplotlib.collections.PathCollection at 0x7f38db8a2d68>

piechart:

38 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

from the dataframe above


In [94]: plt.figure(figsize=(16,9))
plt.pie(y)
plt.show()

39 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [97]: plt.figure(figsize=(16,9))
plt.pie(y,labels=df['Genres'])
plt.show()

In [110]: df=pd.read_csv('/home//user2/Documents/ml+python/googleplaystore.csv'
x=df['Rating']
y=df['Reviews']

40 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [111]: plt.figure(figsize=(16,9))
plt.pie(y,labels=df['Genres'])
plt.show()

41 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [118]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
plt.pie(y,labels=df['Genres'],explode=explode)
plt.show()

42 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [120]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors)
plt.show()

43 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [121]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.1f%
plt.show()

44 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [122]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

45 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [123]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.4f%
plt.show()

46 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [125]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

47 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [127]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

48 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [128]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

49 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [139]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":10,"rotation":20}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

50 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [141]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":10,"rotation":20,"color":'g'}
wedgeprops={"linewidth":4,"width":1,"edgecolor":"k"}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
plt.show()

51 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [153]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":10,"rotation":20,"color":'r'}
wedgeprops={"linewidth":4,"width":1,"edgecolor":"k"}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
startangle=90,textprops=textprops,center=(2,3),shadow=True,wedgepro
plt.show()

52 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [157]: plt.figure(figsize=(20,12))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":20,"rotation":20,"color":'r'}
wedgeprops={"linewidth":4,"width":1,"edgecolor":"k"}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
startangle=90,textprops=textprops,center=(2,3),shadow=True,wedgepro
plt.show()

53 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [162]: plt.figure(figsize=(16,9))
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]
colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":10,"rotation":20,"color":'r'}
wedgeprops={"linewidth":4,"width":1,"edgecolor":"k"}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
startangle=90,textprops=textprops,center=(2,3),shadow=True,wedgepro
plt.legend()
plt.show()

In [163]: colors=['y','r','g','k','y','r','g','k','y','r','g','k','y','r','g',
len(colors)

Out[163]: 20

In [164]: labels=np.ones(20)

In [173]: plt.figure(figsize=(12,8))
plt.pie([1],colors='k',radius=2.04)
plt.pie(labels,colors=colors,radius=2)
plt.pie([1],colors='w',radius=1.8)
plt.pie([1],colors='y',radius=1.6)
plt.pie(labels,colors=colors,radius=1.5)
plt.pie([1],colors='c',radius=1.4)
plt.pie([1],colors='m',radius=1.2)

54 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.pie(labels,colors=colors,radius=1.1)
plt.pie([1],colors='b',radius=1.0)
plt.pie([1],colors='r',radius=0.8)
plt.pie(labels,colors=colors,radius=0.7)
plt.pie([1],colors='k',radius=0.6)
plt.pie([1],colors='r',radius=0.4)
plt.pie(labels,colors=colors,radius=0.3)
plt.pie([1],colors='y',radius=0.2)
plt.pie([1],colors='k',radius=0.1)
plt.show()

SUBPLOT

55 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [213]: plt.subplot(2,2,1)
plt.pie([1],autopct="%0.1f%%")
plt.subplot(2,2,2)
plt.pie([1,2],autopct="%0.1f%%")
plt.subplot(2,2,3)
plt.pie([1,2,3],autopct="%0.1f%%")

plt.subplot(2,2,4)#,projection='polar'
plt.pie([1,2,3,4],autopct="%0.1f%%")
plt.show()

In [225]: plt.figure(figsize=(20,12))
#plt.subplot(3,2,1) or we can use the following code without commas
plt.subplot(321)
from matplotlib import style
plt.plot(days,temperature,'yo--',linewidth=3,markersize=6)
plt.plot(days,dangadhi_tem,'ro--',linewidth=3,markersize=6)
style.use("ggplot")
plt.title('ktm & Dhangadhi temperarture',fontsize=16,color='g')
plt.xlabel('days',fontsize=16,color='c')
plt.ylabel('temperature',fontsize=16,color='k')
plt.legend(['tem line_for_ktm','Tem line for dhangadhi'],loc=6)
plt.grid(color="k",linestyle="-.",linewidth=2)

plt.subplot(3,2,2)
plt.bar(classes,class1_std,width=0.8,align='edge',color='g',edgecolor
plt.subplot(3,2,3)
bins=[15,20,25,30,35,40,45]
plt.hist(phys_std_age,bins,rwidth=0.8,color="y",histtype='barstacked'
plt.hist(chem_std_age,rwidth=0.8,color="m",histtype='barstacked',align
plt.title('physics student ages')
plt.xlabel("age category")
plt.ylabel("no of std age")
plt.legend()
plt.subplot(3,2,4) #-------------------------------------------------------
#**************************************************************************

plt.title('google play store acatter plot')


plt.xlabel('Ratings')
plt.ylabel('Reviews')
plt.scatter(x,y,c='k',marker="*",s=50,alpha=.8,linewidth=2,edgecolor=
plt.scatter(x,df['Installs'],c='g',marker="o",s=50,alpha=.8,linewidth
plt.subplot(3,2,5) #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
explode=[0,0,0,0,0.5,0.4,0,0,0.2,0.3]

56 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

colors=['c','r','y','g','k','m','b','r','k']
textprops={"fontsize":10,"rotation":20,"color":'r'}
wedgeprops={"linewidth":4,"width":1,"edgecolor":"k"}
plt.pie(y,labels=df['Genres'],explode=explode,colors=colors,autopct="%0.2f%
startangle=90,textprops=textprops,center=(2,3),shadow=True,wedgepro
#plt.legend()

plt.subplot(3,2,6)
plt.pie([1],colors='k',radius=2.04)
plt.pie(labels,colors=colors,radius=2)
plt.pie([1],colors='w',radius=1.8)
plt.pie([1],colors='y',radius=1.6)
plt.pie(labels,colors=colors,radius=1.5)
plt.pie([1],colors='c',radius=1.4)
plt.pie([1],colors='m',radius=1.2)
plt.pie(labels,colors=colors,radius=1.1)
plt.pie([1],colors='b',radius=1.0)
plt.pie([1],colors='r',radius=0.8)
plt.pie(labels,colors=colors,radius=0.7)
plt.pie([1],colors='k',radius=0.6)
plt.pie([1],colors='r',radius=0.4)
plt.pie(labels,colors=colors,radius=0.3)
plt.pie([1],colors='y',radius=0.2)
plt.pie([1],colors='k',radius=0.1)
plt.savefig("testfig",format="pdf")
plt.show()

In [216]: plt.figure(figsize=(12,8))
plt.pie([1],colors='k',radius=2.04)
plt.pie(labels,colors=colors,radius=2)
plt.pie([1],colors='w',radius=1.8)
plt.pie([1],colors='y',radius=1.6)
plt.pie(labels,colors=colors,radius=1.5)
plt.pie([1],colors='c',radius=1.4)
plt.pie([1],colors='m',radius=1.2)
plt.pie(labels,colors=colors,radius=1.1)
plt.pie([1],colors='b',radius=1.0)

57 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.pie([1],colors='r',radius=0.8)
plt.pie(labels,colors=colors,radius=0.7)
plt.pie([1],colors='k',radius=0.6)
plt.pie([1],colors='r',radius=0.4)
plt.pie(labels,colors=colors,radius=0.3)
plt.pie([1],colors='y',radius=0.2)
plt.pie([1],colors='k',radius=0.1)
plt.show()
plt.savefig("pie_chart",dpi=100,facecolor="g")#,quality=99()

In [220]: plt.pie([30,50,60],autopct="%0.1f%%")
plt.show()
plt.savefig("pie_chart2",dpi=100,facecolor='y')

<Figure size 432x288 with 0 Axes>

Image
In [242]: import matplotlib.image as im
img=im.imread("/home/user2/Documents/ml+python/oleg-ivanov-QhR78CbFPoE-unsp

In [243]: img

Out[243]:

58 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

array([[[185, 182, 177],


[184, 181, 176],
[175, 172, 167],
...,
[127, 114, 97],
[141, 128, 111],
[144, 131, 114]],

[[190, 187, 182],


[186, 183, 178],
[174, 171, 166],
...,
[133, 120, 103],
[142, 129, 112],
[145, 132, 115]],

[[198, 195, 190],


[192, 189, 184],
[180, 177, 172],
...,
[131, 118, 102],
[134, 121, 105],
[134, 121, 105]],

...,

[[ 39, 26, 20],


[ 41, 28, 22],
[ 41, 28, 22],
...,
[ 92, 72, 65],
[ 89, 69, 62],
[ 85, 65, 58]],

[[ 36, 23, 17],


[ 39, 26, 20],
[ 40, 27, 21],
...,
[ 87, 67, 60],
[ 85, 65, 58],
[ 80, 60, 53]],

[[ 38, 24, 21],


[ 39, 25, 22],
[ 45, 31, 28],
...,
[ 84, 64, 57],
[ 84, 64, 57],
In [244]: type(img)

Out[244]: numpy.ndarray

In [245]: img.ndim

Out[245]: 3

59 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [246]: img.shape

Out[246]: (5569, 3708, 3)

In [249]: plt.axis("off")
plt.imshow(img)
plt.show()

60 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [251]: plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(img)
plt.show()

61 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [253]: plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(img)
plt.grid(False)
plt.colorbar()
plt.show()

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
5: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.
"""

62 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [274]: plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(img,cmap="hot")
plt.grid(False)
plt.colorbar()
plt.show()

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
5: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.
"""

63 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [255]: plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(img,cmap="Accent")
plt.grid(False)
plt.colorbar()
plt.show()

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
5: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.
"""

In [268]: chnl=img[:,:,0]
plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(chnl,cmap="hot")
plt.grid(False)
plt.colorbar()

64 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.show()
/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.

In [269]: chnl=img[:,:,1]
plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(chnl,cmap="hot")
plt.grid(False)
plt.colorbar()
plt.show()

65 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:

66 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [270]: chnl=img[:,:,2]
plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(chnl,cmap="hot")
plt.grid(False)
plt.colorbar()
plt.show()

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.

In [272]: plt.figure(figsize=(16,12))
plt.axis("off")
plt.imshow(chnl,cmap="nipy_spectral")
plt.grid(False)
plt.colorbar()

67 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

plt.show()

/snap/jupyter/6/lib/python3.7/site-packages/ipykernel_launcher.py:
5: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor()
and pcolormesh() is deprecated since 3.5 and will be removed two mi
nor releases later; please call grid(False) first.
"""

In [288]: cmap="""Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu,
camp_list= cmap.split(sep = ", ")

In [289]: camp_list

Out[289]:

68 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

['Accent',
'Accent_r',
'Blues',
'Blues_r',
'BrBG',
'BrBG_r',
'BuGn',
'BuGn_r',
'BuPu',
'BuPu_r',
'CMRmap',
'CMRmap_r',
'Dark2',
In [285]: save_image_addr_name = []
for i in range(len(camp_list)):
cmap_str = camp_list[i]
save_image_addr_name.append("/home/user2/Documents/ml+python"+"girl_"
print(save_image_addr_name[i])

/home/user2/Documents/ml+pythongirl_'Accent'.png
/home/user2/Documents/ml+pythongirl_'Accent_r'.png
/home/user2/Documents/ml+pythongirl_'Blues'.png
/home/user2/Documents/ml+pythongirl_'Blues_r'.png
/home/user2/Documents/ml+pythongirl_'BrBG'.png
/home/user2/Documents/ml+pythongirl_'BrBG_r'.png
/home/user2/Documents/ml+pythongirl_'BuGn'.png
/home/user2/Documents/ml+pythongirl_'BuGn_r'.png
/home/user2/Documents/ml+pythongirl_'BuPu'.png
/home/user2/Documents/ml+pythongirl_'BuPu_r'.png
/home/user2/Documents/ml+pythongirl_'CMRmap'.png
/home/user2/Documents/ml+pythongirl_'CMRmap_r'.png
/home/user2/Documents/ml+pythongirl_'Dark2'.png
/home/user2/Documents/ml+pythongirl_'Dark2_r'.png
/home/user2/Documents/ml+pythongirl_'GnBu'.png
/home/user2/Documents/ml+pythongirl_'GnBu_r'.png
/home/user2/Documents/ml+pythongirl_'Greens'.png
/home/user2/Documents/ml+pythongirl_'Greens_r'.png
/home/user2/Documents/ml+pythongirl_'Greys'.png
/home/user2/Documents/ml+pythongirl_'Greys_r'.png
In [290]: for i in range(len(camp_list)):
cmap_name = camp_list[i]
plt.figure(figsize=(16,9))
plt.axis("off")

print(cmap_name)

plt.imshow(chnl, cmap=cmap_name)
#plt.colorbar()
#save_image_name1 = "D:\\cmap_image\\"+"girl" + cmap_list[i]
print(save_image_addr_name[i])
plt.savefig(save_image_addr_name[i], orientation='portrate', facecolor
plt.show()

Accent
/home/user2/Documents/ml+pythongirl_'Accent'.png

69 of 70 6/22/22, 10:46 AM
matplotlib http://localhost:8888/notebooks/Documents/ml%2Bpyt...

In [ ]:

70 of 70 6/22/22, 10:46 AM

You might also like