Python matplotlib 标签不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14657169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 12:04:32 来源:igfitidea点击:
matplotlib label doesn't work
提问by PythonRunner
When I execute the following code, it doesn't produce a plot with a label.
当我执行以下代码时,它不会生成带有标签的图。
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
plt.plot(x, x*1.5, label='Normal')
Numpy version is '1.6.2' Matplotlib version is '1.3.x'
Numpy 版本是“1.6.2” Matplotlib 版本是“1.3.x”
Any ideas as to why this is happening?
关于为什么会发生这种情况的任何想法?


