Pandas - 散布矩阵集标题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39787204/
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-09-14 02:06:58 来源:igfitidea点击:
Pandas - scatter matrix set title
提问by J.To
I'm searching for a way to set a title to Pandas scatter matrix
:
我正在寻找一种为 Pandas 设置标题的方法scatter matrix
:
from pandas.tools.plotting import scatter_matrix
scatter_matrix(data, alpha=0.5,diagonal='kde')
I tried plt.title('scatter-matrix')
but it creates a new figure.
我试过了,plt.title('scatter-matrix')
但它创造了一个新的数字。
Any help is appreciated.
任何帮助表示赞赏。
回答by jezrael
I think you need suptitle
:
我认为你需要suptitle
:
import matplotlib.pyplot as plt
from pandas.tools.plotting import scatter_matrix
scatter_matrix(df, alpha=0.5,diagonal='kde')
plt.suptitle('scatter-matrix')
plt.show()