2023年5月6日(软件工程日报)

今日学习

web中servlet相关内容

jsp相关内容

计网复习

python

)、函数图形1绘制

【源代码程序】

import matplotlib.pyplot as plt

import numpy as np

 

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

y1 = x ** 2

y2 = np.cos(x * 2)

y3 = y1 * y2

plt.plot(x, y1,linestyle='-.')

plt.plot(x, y2,linestyle=':')

plt.plot(x, y3,linestyle='--')

plt.savefig("3-1.png")

plt.show()

fig, subs = plt.subplots(2, 2)

subs[0][0].plot(x, y1)

subs[0][1].plot(x, y2)

subs[1][0].plot(x, y3)

plt.savefig("3-2.png")

plt.show()

 

(四)、函数图形2绘制

 

【源代码程序】

 

import matplotlib.pyplot as plt

 

import numpy as np

 

 

 

x = np.arange(-2, 2, 0.0001)

 

y1 = np.sqrt(2 * np.sqrt(x ** 2) - x ** 2)

 

y2 = (-2.14) * np.sqrt(np.sqrt(2) - np.sqrt(np.abs(x)))

 

plt.plot(x, y1, 'r', x, y2, 'r')

 

plt.fill_between(x, y1, y2, facecolor='red')

 

plt.savefig("heart.png")

 

posted @ 2023-05-06 22:04  摆烂达人  阅读(3)  评论(0编辑  收藏  举报