你好,我是Python和Seaborn的新手。我只想为Seaborn关节图设置x限制和y限制。此外,我想在主图上方和右侧绘制此图,而没有分布信息。我怎样才能做到这一点?我正在尝试这样的事情:
import numpy as np
import matplotlib.pyplot as plt from
matplotlib.ticker import NullFormatter
import seaborn as sns
sns.set(style="ticks")
xData = np.random.rand(100,1)*5
yData = np.random.rand(100,1)*10
xlim = [-15 15]
ylim = [-20 20]
g = sns.jointplot(xData, yData, kind="hex", color="b", xlim, ylim)
答案 0 :(得分:2)
xlim
和ylim
应该是元组。因此您的代码应为:
import numpy as np
import matplotlib.pyplot as plt from
matplotlib.ticker import NullFormatter
import seaborn as sns
sns.set(style="ticks")
xData = np.random.rand(100,1)*5
yData = np.random.rand(100,1)*10
g = sns.jointplot(xData, yData, kind="hex", color="b", xlim = (-15,15), ylim = (-20,20))
答案 1 :(得分:0)