-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalc_tax_only_taiwan.py
27 lines (22 loc) · 1.01 KB
/
calc_tax_only_taiwan.py
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
import matplotlib.markers as markers
import numpy as np
import matplotlib.pyplot as plt
from algorithm_tax.Taiwan import *
salary = range(10000, 10000*12, 1000)
tax = [TaiwanTax(s).tax() for s in salary]
health_insurance = [TaiwanTax(s).health_insurance_fee() for s in salary]
labor_insurance = [TaiwanTax(s).labor_insurance_fee() for s in salary]
income = np.array(salary) - tax - health_insurance - labor_insurance
fig, ax = plt.subplots()
ax.set_title('[Tax, Income, Health Insurance, Labor Insurance] vs Salary in Taiwan')
ax.set_xlabel('Salary')
ax.set_ylabel('Tax, Income, Health Insurance, Labor Insurance')
marker = markers.MarkerStyle(marker='*', fillstyle='none')
ax.scatter(x=salary, y=tax, marker=marker, color='r', alpha=0.5)
ax.scatter(x=salary, y=income, marker=marker, color='y', alpha=0.5)
ax.scatter(x=salary, y=health_insurance, marker=marker, color='g', alpha=0.5)
ax.scatter(x=salary, y=labor_insurance, marker=marker, color='b', alpha=0.5)
ax.grid(True)
fig.tight_layout()
fig.autofmt_xdate()
plt.show()