From 1b7f1732fe1d52f99a6d11c4eca8fd76e9ab4b45 Mon Sep 17 00:00:00 2001 From: Divya-15-09 Date: Tue, 20 May 2025 00:02:43 +0530 Subject: [PATCH] Update 6-histogram.ipynb --- src/6-histogram.ipynb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/6-histogram.ipynb b/src/6-histogram.ipynb index 5e6e6b60..d8527083 100644 --- a/src/6-histogram.ipynb +++ b/src/6-histogram.ipynb @@ -15,6 +15,20 @@ "source": [ "# TASK: Create a histogram for the following data: data = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5].\n", "# Customize the histogram with a title, labels for the x-axis, and a specific color for the bars." +import matplotlib.pyplot as plt + +# Data +data = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5] + +# Plotting +plt.hist(data, bins=5, color='skyblue', edgecolor='black') # 5 bins for values 1 through 5 +plt.title("Histogram of Data Values") +plt.xlabel("Value") +plt.ylabel("Frequency") +plt.grid(axis='y', linestyle='--', alpha=0.7) + +plt.show() + ] } ],