Based on this answer, I can use .fig.subplots_adjust()
to shift my clustermap to the bottom half of my final figure. I'd like to plot a line above it representing some associated data, but I can't seem to change its size. Most solutions I've seen online for changing a lineplot's dimensions are actually changing the dimensions of the figure containing it, which won't work here, and I've tried passing it arguments like figsize, height or aspect and none seem to work. How can I get the aspect ratio to fit in this combined figure?
Basic code to generate where I'm at:
iris = sns.load_dataset("iris")
species = iris.pop("species")
g = sns.clustermap(iris)
g.fig.set_size_inches(20, 10)
g.fig.subplots_adjust(top=0.5)
ax = g.fig.add_axes([0.05, 0.05, 0.4, 0.9])
rand_melt = pd.melt(pd.DataFrame(np.random.randn(1000).cumsum()))
sns.lineplot(x=rand_melt.index, y="value", data=rand_melt, ax=ax)
plt.plot()
I would rather use seaborn for this as my data is formatted for it and I know what style and parameters to use for the line plot, but if it isn't possible at all, I'll create another question.