python-3.x - 图例和 x 标签问题
问题描述
我几乎有一个不错的情节,但也有问题。第一个: x 标签不显示。第二个问题:我不能把第二行的名字放在图例中。我只有一个名字(关闭),我还需要“KGHM”。
fig, ax = plt.subplots()
ax.plot(x,y)
ax2 = ax.twinx()
ax2.plot(x1,y1, 'y-')
myFmt = DateFormatter("%d-%m-%y")
ax.xaxis.set_major_formatter(myFmt)
fig.autofmt_xdate()
plt.tight_layout()
plt.xlabel('PLN',size=10)
plt.ylabel('Points',size=10)
plt.title('KGHM')
ax.grid(True)
ax.legend()
plt.show()
感谢帮助 !
解决方案
推荐阅读
- javascript - 如何找到字符串的相似元素
- angular - 使用单独开发时如何从Angular2中的后端获取令牌?
- python - 熊猫:当我用 .to_csv() 保存数据框时,删除列上的“,”
- java - 使用 Jmeter 检查在 s3 上上传的文件
- r - 使用 str_match 时,如何获取没有起始字符串的输出矩阵列?
- html - 搜索框边框上的占位符文本和搜索图标未直接对齐
- javascript - 通过嵌套属性获取父对象
- haskell - 如何导入“System.IO.Strict”?(哈斯克尔)
- python - 如何使用 Python 在 bash 脚本上显示重音词 JSON
- date - 如何从前几行中排除特定日期期间的数据