from matplotlib import pyplot as plt
时间: 2023-11-05 19:32:09 浏览: 121
matplotlib.pyplot.matshow 矩阵可视化实例
# Sample data for plotting
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
# Create a figure and axis object
fig, ax = plt.subplots()
# Plot the data
ax.plot(x, y)
# Customize the plot
ax.set_title('Sample Plot')
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
# Show the plot
plt.show()
阅读全文