ITP

BSc IT - Programming in Python

Plotting Graphs using Matplotlib.

In : BSc IT Subject : Programming in Python

import matplotlib.pyplot as plt

# Sample data

x = [1, 2, 3, 4, 5]

y = [2, 3, 5, 7, 11]

# Create a line plot

plt.plot(x, y, marker='o')

# Add titles and labels

plt.title('Simple Line Plot')

plt.xlabel('X-axis')

plt.ylabel('Y-axis')

# Show the grid

plt.grid()

# Show the plot

plt.show()

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap