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() + ] } ],