Repository navigation
Expand file tree
/
Copy pathMat_Plot_Lib_1.py
More file actions
200 lines (157 loc) · 7.27 KB
/
Copy pathMat_Plot_Lib_1.py
File metadata and controls
200 lines (157 loc) · 7.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# profitList = df ['total_profit'].tolist()
# monthList = df ['month_number'].tolist()
# plt.plot(monthList, profitList, label = 'Month-wise Profit data of last year')
# plt.xlabel('Month number')
# plt.ylabel('Profit in dollar')
# plt.xticks(monthList)
# plt.title('Company profit per month')
# plt.yticks([100000, 200000, 300000, 400000, 500000])
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# profitList = df ['total_profit'].tolist()
# monthList = df ['month_number'].tolist()
# plt.plot(monthList, profitList, label = 'Profit data of last year',
# color='r', marker='o', markerfacecolor='k',
# linestyle='--', linewidth=3)
# plt.xlabel('Month Number')
# plt.ylabel('Profit in dollar')
# plt.legend(loc='lower right')
# plt.title('Company Sales data of last year')
# plt.xticks(monthList)
# plt.yticks([100000, 200000, 300000, 400000, 500000])
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# faceCremSalesData = df ['facecream'].tolist()
# faceWashSalesData = df ['facewash'].tolist()
# toothPasteSalesData = df ['toothpaste'].tolist()
# bathingsoapSalesData = df ['bathingsoap'].tolist()
# shampooSalesData = df ['shampoo'].tolist()
# moisturizerSalesData = df ['moisturizer'].tolist()
# plt.plot(monthList, faceCremSalesData, label = 'Face cream Sales Data', marker='o', linewidth=3)
# plt.plot(monthList, faceWashSalesData, label = 'Face Wash Sales Data', marker='o', linewidth=3)
# plt.plot(monthList, toothPasteSalesData, label = 'ToothPaste Sales Data', marker='o', linewidth=3)
# plt.plot(monthList, bathingsoapSalesData, label = 'ToothPaste Sales Data', marker='o', linewidth=3)
# plt.plot(monthList, shampooSalesData, label = 'ToothPaste Sales Data', marker='o', linewidth=3)
# plt.plot(monthList, moisturizerSalesData, label = 'ToothPaste Sales Data', marker='o', linewidth=3)
# plt.xlabel('Month Number')
# plt.ylabel('Sales units in number')
# plt.legend(loc='upper left')
# plt.xticks(monthList)
# plt.yticks([1000, 2000, 4000, 6000, 8000, 10000, 12000, 15000, 18000])
# plt.title('Sales data')
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# toothPasteSalesData = df ['toothpaste'].tolist()
# plt.scatter(monthList, toothPasteSalesData, label = 'Tooth paste Sales data')
# plt.xlabel('Month Number')
# plt.ylabel('Number of units Sold')
# plt.legend(loc='upper left')
# plt.title(' Tooth paste Sales data')
# plt.xticks(monthList)
# plt.grid(True, linewidth= 1, linestyle="--")
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# faceCremSalesData = df ['facecream'].tolist()
# faceWashSalesData = df ['facewash'].tolist()
# plt.bar([a-0.25 for a in monthList], faceCremSalesData, width= 0.25, label = 'Face Cream sales data', align='edge')
# plt.bar([a+0.25 for a in monthList], faceWashSalesData, width= -0.25, label = 'Face Wash sales data', align='edge')
# plt.xlabel('Month Number')
# plt.ylabel('Sales units in number')
# plt.legend(loc='upper left')
# plt.title(' Sales data')
# plt.xticks(monthList)
# plt.grid(True, linewidth= 1, linestyle="--")
# plt.title('Facewash and facecream sales data')
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# bathingsoapSalesData = df ['bathingsoap'].tolist()
# plt.bar(monthList, bathingsoapSalesData)
# plt.xlabel('Month Number')
# plt.ylabel('Sales units in number')
# plt.title(' Sales data')
# plt.xticks(monthList)
# plt.grid(True, linewidth= 1, linestyle="--")
# plt.title('bathingsoap sales data')
# plt.savefig('C:\\PythonProgramming\\Data\\company_sales_data_of_bathingsoap.png', dpi=150)
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# profitList = df ['total_profit'].tolist()
# labels = ['low', 'average', 'Good', 'Best']
# profit_range = [150000, 175000, 200000, 225000, 250000, 300000, 350000]
# plt.hist(profitList, profit_range, label = 'Profit data')
# plt.xlabel('Profit Range in Dollars')
# plt.ylabel('Actual Profit in Dollars')
# plt.legend(loc='upper left')
# plt.xticks(profit_range)
# plt.title('Profit data')
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# labels = ['Face Cream', 'Face Wash', 'ToothPaste', 'Bathing soap', 'Shampoo', 'Moisturizer']
# salesData = [df ['facecream'].sum(), df ['facewash'].sum(), df ['toothpaste'].sum(),
# df ['bathingsoap'].sum(), df ['shampoo'].sum(), df ['moisturizer'].sum()]
# plt.axis("equal")
# plt.pie(salesData, labels=labels, autopct='%1.1f%%')
# plt.legend(loc='lower right')
# plt.title('Sales data')
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# bathingsoap = df ['bathingsoap'].tolist()
# faceWashSalesData = df ['facewash'].tolist()
# f, axarr = plt.subplots(2, sharex=True)
# axarr[0].plot(monthList, bathingsoap, label = 'Bathingsoap Sales Data', color='k', marker='o', linewidth=3)
# axarr[0].set_title('Sales data of Bathingsoap')
# axarr[1].plot(monthList, faceWashSalesData, label = 'Face Wash Sales Data', color='r', marker='o', linewidth=3)
# axarr[1].set_title('Sales data of Facewash')
# plt.xticks(monthList)
# plt.xlabel('Month Number')
# plt.ylabel('Sales units in number')
# plt.show()
# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_csv("C:\\PythonProgramming\\Data\\company_sales_data.csv")
# monthList = df ['month_number'].tolist()
# faceCremSalesData = df ['facecream'].tolist()
# faceWashSalesData = df ['facewash'].tolist()
# toothPasteSalesData = df ['toothpaste'].tolist()
# bathingsoapSalesData = df ['bathingsoap'].tolist()
# shampooSalesData = df ['shampoo'].tolist()
# moisturizerSalesData = df ['moisturizer'].tolist()
# plt.plot([],[],color='m', label='Face Cream', linewidth=5)
# plt.plot([],[],color='c', label='Face Wash', linewidth=5)
# plt.plot([],[],color='r', label='Toothpaste', linewidth=5)
# plt.plot([],[],color='k', label='Bathing Soap', linewidth=5)
# plt.plot([],[],color='g', label='Shampoo', linewidth=5)
# plt.plot([],[],color='y', label='Moisturizer', linewidth=5)
# plt.stackplot(monthList, faceCremSalesData, faceWashSalesData, toothPasteSalesData,
# bathingsoapSalesData, shampooSalesData, moisturizerSalesData,
# colors=['m','c','r','k','g','y'])
# plt.xlabel('Month Number')
# plt.ylabel('Sales units in Number')
# plt.title('All product sales data using stack plot')
# plt.legend(loc='upper left')
# plt.show()