I have a dataframe of the form:
df = pd.DataFrame(np.array([[0.2, 0.5, 0.3, 0.1],
[0.1, 0.2, 0.5, 0.6],
[0.4, 0.3, 0.3, 0.6]]),
columns=['a', 'b', 'X', 'Y'])
and I want to perform all possible scatter plots between two subsets of columns: set1 = ['a', 'b']
, and set2 = ['X', 'Y']
. I'd like to place all these subplots in a "matrix" like:
size_set1 = len(set1)
size_set2 = len(set2)
df.plot(subplots=True, layout=(size_set1,size_set2), figsize=(30,30));
This is as far as I got, but this code does not produce scatter plots, and it just seems to plot each column instead of columns against each other.
The desired output should be (for this example) 4 scatter plots, (X,a), (X,b), (Y,a), (Y,b)
, arranged 2 above and 2 below.