From 526a2bf31a43c62742ba00963e692c06a6d76f4a Mon Sep 17 00:00:00 2001 From: Divya-15-09 Date: Mon, 19 May 2025 23:56:32 +0530 Subject: [PATCH] Update 1-line-plot.ipynb --- src/1-line-plot.ipynb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/1-line-plot.ipynb b/src/1-line-plot.ipynb index eab74494..bd12ec45 100644 --- a/src/1-line-plot.ipynb +++ b/src/1-line-plot.ipynb @@ -13,8 +13,21 @@ "metadata": {}, "outputs": [], "source": [ - "# TASK: Create a line plot with x values ranging from 0 to 10 and y values as the square of x.\n", - "# Customize the plot by adding a title, labels for both axes, and a grid." + import matplotlib.pyplot as plt +import numpy as np + +# Data +x = np.arange(0, 11) # x values from 0 to 10 +y = x ** 2 # y values as the square of x + +# Plotting +plt.plot(x, y, marker='o') # Line plot with markers +plt.title("Square of Numbers from 0 to 10") # Title +plt.xlabel("X Values") # X-axis label +plt.ylabel("Y = X Squared") # Y-axis label +plt.grid(True) # Show grid +plt.show() + ] } ],