Creating a simple line plot using matplotlib

Creating data for x-axis

x = np.arange(0, 10, 0.1)

Creating data for y-axis

y = np.sin(x)

Creating the plot

plt.plot(x, y)

Adding labels to the plot

plt.xlabel('x-axis') plt.ylabel('y-axis') plt.title('Simple Line Plot')

Displaying the plot

plt.show()

import numpy as npimport matplotlibpyplot as plt

原文地址: https://www.cveoy.top/t/topic/bXQl 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录