I created three figures using seaborn relplot. Each one is a single row with a different y variable, but the same x, column, and hue variables. I want to visualize these three rows all on the same figure. I could make a new figure and copy the contents over, but that would lose the formatting and I am hoping seaborn offers this functionality, but I cannot find it.
My data is in a pandas dataframe named sample:
In: sample
Out:
X Val Col Val Hue Val Y Val Row 1 Y Val Row 2 Y Val Row 3
0 0.95 0.4 0.4 0.638958 0.635887 1061
1 0.96 0.4 0.4 0.639547 0.654841 976
2 0.97 0.4 0.4 0.638076 0.675838 916
3 0.98 0.4 0.4 0.633368 0.689067 831
4 0.99 0.4 0.4 0.629690 0.711538 719
.. ... ... ... ... ... ...
120 0.95 0.8 0.8 0.634979 0.624095 1066
121 0.96 0.8 0.8 0.635565 0.642270 986
122 0.97 0.8 0.8 0.635272 0.665792 916
123 0.98 0.8 0.8 0.633221 0.687564 826
124 0.99 0.8 0.8 0.629852 0.712159 706
[125 rows x 6 columns]
I have created three relplot figures:
import seaborn as sns
g1 = sns.relplot(data=sample, x="X Val", y = "Y Val Row 1", col="Col Val", hue="Hue Val", kind="line")
g3 = sns.relplot(data=sample, x="X Val", y = "Y Val Row 3", col="Col Val", hue="Hue Val", kind="line")
g2 = sns.relplot(data=sample, x="X Val", y = "Y Val Row 2", col="Col Val", hue="Hue Val", kind="line")
Each figure (g1, g2, g3) is a single row of five axes objects, each with the same column values, hue values, and x values. I want to combine these into one figure of these three rows stacked. I combined the figures in power point to show what I want for the final result:
Complete figure, with g1 as row 1, g2 as row 2, and g3 as row 3: