Python - libraries
Jump to navigation
Jump to search
About
NOTE: This page is a daughter page of: Python
Here are some third-party libraries that might be useful.
matplotlib library
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Here's an example of using matplotlib.pyplot.
import numpy as np
import matplotlib.pyplot as plt
# Create an array of x values from 0 to 2*pi (a full sine wave cycle)
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x)
# Create the plot
plt.figure(figsize=(8, 6))
plt.plot(x, y, label='Sine Wave', color='blue')
plt.title('Simple Sine Wave')
plt.xlabel('X Values')
plt.ylabel('Y Values')
plt.grid(True)
plt.legend()
# Show the plot
plt.show()