sara
sara

Reputation: 115

How to plot two values as a histogram using Python?

I have to plot two values as a histogram using python.

 File=[1,2,3] 
 File1=[3,4,5,6] 
 files=len(File) 
 files1=len(File1)

I want to plot the length of the files. files and files1 should be on the x-axis and the y-axis needs to have the count like 0, 10, 20 ....

Below is an example diagram. Example bar plot

Upvotes: 1

Views: 3400

Answers (1)

MB-F
MB-F

Reputation: 23647

I guess you want a bar plot like this:

import matplotlib.pyplot as plt

plt.bar([0, 1], [files, files1])
plt.show()

Check out the matplotlib examples if you want to find out how to format and change labels, axis limits, etc.

results

Upvotes: 1

Related Questions