INNER CODE UNIT · Python
scatter_plot
ashishpatel26/Amazing-Feature-Engineering · data_exploration/explore.py:147
def scatter_plot(x,y,data,output_path=None):
"""draw the scatter-plot of two variables.
Parameters
----------
Returns
-------
figure save as PNG
"""
plt.figure(figsize=(15,10))
sns.scatterplot(x=x,y=y,data=data)
if output_path is not None:
output = os.path.join(output_path,'Scatter_plot_'+str(x.name)+'_'+str(y.name)+'.png')
plt.savefig(output)
print('Image saved at',str(output))