python matplotlib如何显示标签

2024-06-28 16:02:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经花了几个小时浏览各种教程,所以我问后,尝试了一点。我也无法得到一个简单的箭头在偏移X和Y轴。。。你知道吗

from mpl_toolkits.axes_grid.axislines import SubplotZero
from matplotlib import pylab
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})

ax = plt.subplot(111)

sigma = [-4, -2, 0]
jomega = [0, 0, 0]
plt.plot(sigma, jomega, 'x', mew=2, ms=12, linestyle='None')

plt.xlabel("amaranthus")
plt.ylabel('j$\omega')
plt.xlim(-8,2)
plt.ylim(-8,8)

ax.spines['right'].set_color('none')
ax.spines['left'].set_position(('data',0))
ax.spines['top'].set_color('none')
ax.spines['bottom'].set_position(('data',0))

plt.show()

Tags: fromimportnonedatamatplotlibaspositionplt
1条回答
网友
1楼 · 发布于 2024-06-28 16:02:20

谢谢大家的帮助。你知道吗

我无法用上面的代码获得X和Y轴标签。你知道吗

当我把标签代码移到程序的末尾,就在节目(),它们神奇地出现了。你知道吗

就目前而言,我很好,除非你们中的一些人能够立即阐明为什么会发生这样的事情,以造福于其他人。。。你知道吗

最好的, 拉杰什。你知道吗

相关问题 更多 >