简体   繁体   English

Matplotlib不显示标签或数字

[英]Matplotlib does not show labels or numbers

My plots in matplotlib don't show more than one letter/digit. 我在matplotlib中的图表不会显示多个字母/数字。 I do need to use matplotlib from the anaconda folder which is why I'm including sys.path at the beginning. 我确实需要使用anaconda文件夹中的matplotlib,这就是我在开头包含sys.path的原因。 (When I don't include the first 2 lines everything works fine since I have a different matplotlib on my computer. Both are up to date.) Any ideas what I can do to make it work? (当我不包括前两行时,一切正常,因为我的计算机上有一个不同的matplotlib。两者都是最新的。)任何想法我能做些什么来使它工作? I'm using Ubuntu and Sublime Text. 我正在使用Ubuntu和Sublime Text。

Here's my simple code: 这是我的简单代码:

import sys
sys.path.insert(0, "/home/mariusz/anaconda/lib/python2.7/site-packages")
import matplotlib.pyplot as plt

grade_fast = [1,7,3,5,6,7,10,11,12]
bumpy_fast = [0,2,3,5,6,7,10,11,12]
grade_slow = [0,2,3,5,6,7,10,11,12]
bumpy_slow = [0,2,3,5,6,7,10,11,12]

plt.scatter(bumpy_fast, grade_fast, label="f")
plt.scatter(grade_slow, bumpy_slow, label="slow")
plt.legend()
plt.xlabel("bumpiness")
plt.ylabel("g")
plt.show()

结果就是这个情节

我重新安装了matplotlib,numpy,scikit-learn和scipy并且它工作了:)我不知道为什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM