It seems that there is a problem with the size of the subplots or the figure size. You can try specifying the figure size using figure.set_size_inches(width, height), and also adjusting the size of the subplots using fig.tight_layout() or specifying the height and width of the subplots using fig.subplots_adjust(hspace=height, wspace=width).
Additionally, you can also check if there is any overlap with the title and subplots by specifying the subplot_adjust parameter.
A general syntax of subplot is as follows:
Syntax: fig, ax = plt.subplots(nrows, ncols)
- nrows: The number of rows of subplots in the figure.
- ncols: The number of columns of subplots in the figure.
For example, in the code
figure, (ax1,ax2,ax3) = plt.subplots(1, 3, sharex=True),
there is one row and three columns of subplots in the figure, and ax1, ax2, and ax3 are the axes objects for each subplot.
You can then plot on each subplot using the corresponding axis object, e.g.
sns.catplot(ax= ax1, data=ds, x="repeat_retailer",
y="distance_from_home", hue="fraud", jitter = True)
plots on the first subplot using ax1.
EDITED
Then maybe the issue is with seaborns catplots. Have you tried using scatter plot and see if this works?
figure, (ax1, ax2, ax3) = plt.subplots(1, 3, sharex=True)
sns.scatterplot(ax=ax1, data=ds, x="repeat_retailer",
y="distance_from_home", hue="fraud", jitter=True)
sns.scatterplot(ax=ax2, data=ds, x="repeat_retailer", y="distance_from_last_transaction", hue="fraud", jitter=True)
sns.scatterplot(ax=ax3, data=ds, x="repeat_retailer", y="ratio_to_median_purchase_price", hue="fraud", jitter=True)
plt.show()