I have a list of tuples and want to create a scatterplot based on certain requirements. The data set looks like this:
data = [(0.7,48000,1),(1.9,48000,0),(2.5,60000,1),(4.2,63000,0) ...]
The data represents -> Tenure- number of years employed Salary- the employers salary Account- this is a number that specifies 1(paid account) or 0(unpaid)
Using matplotlib I want to create a scatter plot that shows years(x-axis), and salary(y-axis), and whether or not the account is paid or not.
I have the first part of the scatter plot which is amount of years and the salary with the following code: '''
years, salary, account = zip(*data)
plt.scatter(years, salary)
plt.title('Data-Science Club Members')
plt.xlabel('Years as Data Scientist')
plt.ylabel('Salary')
plt.legend()
plt.show()
'''
Here is how my graph look:
Here is how I am trying to make my graph look like:
I am new to stackoverflow so please I am sorry if this is asked properly I tried providing as much info as possible. Thank you!