As I go through online tutorials and\or articles in general, when I encounter a plot that uses the Seaborn distplot plot I re-create it using either histplot or displot.
I do this because distplot is deprecated and I want to re-write the code using newer standards.
I am going through this article: https://www.kite.com/blog/python/data-analysis-visualization-python/
and there is a section using distplot whose output I cannot replicate.
This is the section of code that I am trying to replicate:
col_names = ['StrengthFactor', 'PriceReg', 'ReleaseYear', 'ItemCount', 'LowUserPrice', 'LowNetPrice']
fig, ax = plt.subplots(len(col_names), figsize=(8, 40))
for i, col_val in enumerate(col_names):
x = sales_data_hist[col_val][:1000]
sns.distplot(x, ax=ax[i], rug=True, hist=False)
outliers = x[percentile_based_outlier(x)]
ax[i].plot(outliers, np.zeros_like(outliers), 'ro', clip_on=False)
ax[i].set_title('Outlier detection - {}'.format(col_val), fontsize=10)
ax[i].set_xlabel(col_val, fontsize=8)
plt.show()
Both the distplot itself and the axis variable are no longer used. The code, for now, runs.
In a nutshell, all I am trying to do is replicate the exact output of the code above (rug plot, the red dots representing the removed values, etc.) without using deprecated code.
I have tried various combinations of displot and histplot but I have been unable to get the exact same output any other way.