Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/1-line-plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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()

]
}
],
Expand Down