Algoteka
Log in to submit your own samples!

Plot a Bar Graph

Problem by oml1111
# Tech tags Title Creator Created date
1 0
Matplotlib
2022-08-13 00:25
View all samples for this language (1 verified and 0 unverified)

Simple solution | Python | Matplotlib |

By oml1111 |
0 likes

Plots the following bar graph:
Bar graph

Code

import matplotlib.pyplot as plt

plt.bar(['a', 'b', 'xy'], [3, 7, 5])
plt.show()

Further reading

Pyplot tutorial: Plotting with categorical variables - matplotlib.org

References

functions
matplotlib.pyplot.bar matplotlib.org
matplotlib.pyplot.show matplotlib.org

Problem Description

Plot a categorical bar graph containing at least 3 labeled bars. Include a picture of the graph in the specification.

View sample discussion (0 comments)
View problem discussion (0 comments)