import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Example data generation
np.random.seed(0)
example_data = np.random.poisson(lam=5, size=5000)
# Convert the data into a DataFrame to simulate reading from a CSV
example_df = pd.DataFrame(example_data, columns=['Photon Count'])
# Plot histogram
plt.figure(figsize=(10, 6))
plt.hist(example_df['Photon Count'], bins=30, color='blue', edgecolor='black')
plt.title('Photon Count Histogram')
plt.xlabel('Photon Count')
plt.ylabel('Frequency')
plt.grid(True)
plt.show()
1条答案
按热度按时间deikduxw1#
使用
matplotlib.pyplot.hist
:字符串
输出:
的数据