下面是一个简单的示例代码,使用Python的Matplotlib绘制轮廓,并给第一个轮廓填充灰色:

import matplotlib.pyplot as plt

# 定义轮廓线的坐标
x1 = [1, 2, 3, 4, 5]
y1 = [1, 3, 2, 4, 5]

x2 = [3, 4, 5, 6, 7]
y2 = [3, 4, 3, 5, 6]

# 绘制轮廓线
fig, ax = plt.subplots()
ax.plot(x1, y1, color='black')
ax.plot(x2, y2, color='black')

# 给第一个轮廓填充灰色
ax.fill_between(x1, y1, color='grey', alpha=0.5)

plt.show()

运行这段代码,可以得到如下的轮廓图:

contour_example.png

用python绘制轮廓第一个轮廓用灰色填充

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

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