Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions matplotlib/matplotlib_intro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# matplotlib_intro.py
# ====================================================
# This file introduces the basics of plotting with Matplotlib.

import matplotlib.pyplot as plt

# ---------------------------
# 1. Basic line plot
x = [0, 1, 2, 3, 4]
y = [0, 1, 4, 9, 16]

plt.plot(x, y)
plt.title("Basic Line Plot")
plt.xlabel("X Axis")
plt.ylabel("Y Axis")
plt.grid(True)
plt.show()

# ---------------------------
# 2. Saving the figure to a file
plt.plot(x, y)
plt.title("Saved Line Plot")
plt.xlabel("X")
plt.ylabel("Y")
plt.grid(True)
plt.savefig("saved_plot.png") # Saves the plot to a file
print("Figure saved as 'saved_plot.png'")
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
contourpy==1.3.2
cycler==0.12.1
et_xmlfile==2.0.0
fonttools==4.58.5
kiwisolver==1.4.8
matplotlib==3.10.3
numpy==2.3.1
openpyxl==3.1.5
packaging==25.0
pandas==2.3.1
pillow==11.3.0
pyparsing==3.2.3
python-dateutil==2.9.0.post0
pytz==2025.2
six==1.17.0
Expand Down