Create Bar Chart

107 Views Asked by At

How to create a bar chart like below chart for below question using Python?

Chart

Question: plot job role based on number of individuals who have have master degree AND earn <=50K in the United States

My table is below which I have imported from CSV file.

Degree job rol Country earning Bachelor Admin US. <=50k Master HR. England >=50k

I tried many ways. But could not do it

1

There are 1 best solutions below

0
On

You can import the matplotlib.pyplot as plt and import numpy as np to make a bar graph. Create an array called y = np.array([...]) for example, and create a function called plt.bar(). From there, you can fill in the height and your y variable to create a graph as you desire. Finally, just type plt.show() to display the graph.