有没有什么方法可以使用箱线图但只显示点?在
我有这个:
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data2 = pd.DataFrame(dict(site85_574C=[10,20,30,40, 50], site41_366A=[5,15, 25, 35, 45]), columns=["site85_574C", "site41_366A"])
data2.boxplot(widths=0.05)
plt.scatter(np.repeat(np.arange(data2.shape[1])+1, data2.shape[0]), data2.values.ravel(), marker='+', alpha=1.0)
但我只想看到垂直线上的点,而不是盒子和胡须
注意,}是boxplot的
showbox
和{kwds
,它们依次传递给matplotlib.boxplot
。在参考文献
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.boxplot.html
http://matplotlib.org/api/pyplot_api.html
相关问题 更多 >
编程相关推荐