【发布时间】:2016-03-30 11:44:39
【问题描述】:
我正在关注here 的教程,这似乎是最简单的示例 - 线性关系。
我不清楚非常宽松的导入,并且似乎无法展示我的情节。
my_seaborn_test.py:
import numpy as np
import seaborn as sns
class SeabornTest(object):
def run_example(self):
sns.set(color_codes=True)
np.random.seed(sum(map(ord, "regression")))
tips = sns.load_dataset("tips")
sns.lmplot(x="size", y="tip", data=tips, x_estimator=np.mean)
在命令行上:
python
from my_seaborn_test import SeabornTest
st = SeabornTest()
st.run_example()
我得到的只是沉默和这个警告:
/home/me/anaconda3/envs/myenv/lib/python3.5/site-packages/matplotlib/__init__.py:892: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
warnings.warn(self.msg_depr % (key, alt_key))
【问题讨论】:
-
你可以
import matplotlib.pyplot as plt最后plt.show()