Oz1*_*123 10
我不知道你的数据是什么......但这里是近海表面假设氧含量的"垂直"图.
请注意,不需要任何特殊内容.只需对您的值x和y值进行排序,使得从第一个坐标到第二个坐标绘制的直线等等都会给出您想要的垂直线.
(我在这里做过的一件特别的事情 - 可能是你想要的,也可能不是你想要的 - 将它放在xticks情节的顶部,使用tick_top.)
import matplotlib.pyplot as plt
# define data
Oxygen = [ 0.1 , 0.5, 1, 10, 15, 20, 15, 10, 1, 0.5, 0.5]
Depth = [ 0, 1, 2, 4, 8, 10, 12, 14, 16, 20, 40 ]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(Oxygen, Depth, 'go--')
ax.xaxis.tick_top()
ax.set_ylabel('depth')
ax.set_ylim(50, 0)
ax.set_xlim(0, 25)
ax.set_xlabel('Oxygen level [ppm]')
plt.show()
Run Code Online (Sandbox Code Playgroud)
这会产生:

我希望它有所帮助......
| 归档时间: |
|
| 查看次数: |
6466 次 |
| 最近记录: |