import numpy as np
import matplotlib.pyplot as plt
import sys
%config InlineBackend.figure_format = 'svg'
x = np.arange(-100, 100, 0.001)
y = abs(x)
plt.figure()
plt.plot(x, y,color='blue')
plt.xlim((-1.5, 1.5)) #x轴截取-1.5 到 1.5
plt.ylim((0, 1.5))。#y轴截取0 到 1.5
plt.xlabel('y_hat') #设置标签
plt.ylabel('MAE Loss')
plt.grid() # 生成网格
plt.plot(x, y)
plt.show()
plt画函数图像
于 2022-04-14 13:36:48 首次发布