python对角线图_python对角线图_python – 在Seaborn Jointplot上绘制对角线(相等的线)...
錯(cuò)誤是一個(gè)有用的暗示:JointPlot是子圖的集合,你必須找到特定的斧頭來(lái)繪制.修改Seaborn示例:
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.pyplot import show
sns.set(style="white")
# Generate a random correlated bivariate dataset
rs = np.random.RandomState(5)
mean = [0, 0]
cov = [(2, .25), (.5, 1)] # make it asymmetric as a better test of x=y line
x1, x2 = rs.multivariate_normal(mean, cov, 500).T
x1 = pd.Series(x1, name="$X_1$")
x2 = pd.Series(x2, name="$X_2$")
# Show the joint distribution using kernel density estimation
g = sns.jointplot(x1, x2, kind="kde", size=7, space=0)
x0, x1 = g.ax_joint.get_xlim()
y0, y1 = g.ax_joint.get_ylim()
lims = [max(x0, y0), min(x1, y1)]
g.ax_joint.plot(lims, lims, ':k')
show()
我在翻譯中想到這個(gè):dir(g),然后g.plot?,g.plot_joint? – 那些是繪制特定于聯(lián)合圖的功能 – 還有什么? – dir(g.ax_joint);啊哈,有set_ylim等
總結(jié)
以上是生活随笔為你收集整理的python对角线图_python对角线图_python – 在Seaborn Jointplot上绘制对角线(相等的线)...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: threadlocal存连接对象的目的_
- 下一篇: cdh mysql sqoop 驱动_大