I have a dataset with 2 features with the name pos_x and pos_y and I need to scatter plot the clustered data done with DBScan. Here is what I have tried for it:
import seaborn as sns
import matplotlib.pyplot as plt
colors=['purple','red','blue','green']
Data = []
dataset = pd.read_csv(r'/Users/file_name.csv')
Datadb = dataset[["pos_x","pos_y"]]
dbscan=DBSCAN()
clusters =dbscan.fit(Datadb.to_numpy())
p = sns.scatterplot(data=Datadb, x="pos_x", y="pos_y", hue=clusters.labels_, legend="full", palette="deep")
sns.move_legend(p, "upper right", bbox_to_anchor=(1.17, 1.2), title='Clusters')
plt.show()
but it shows me the following error:
ValueError: Image size of 447x412817 pixels is too large. It must be less than 2^16 in each direction.
I even tried the following but again I got the same error!
fig = plt.gcf()
fig.set_size_inches(12, 8)
p = sns.scatterplot(data=Datadb, x="pos_x", y="pos_y", hue=clusters.labels_, legend="full", palette="deep")
sns.move_legend(p, "upper right", bbox_to_anchor=(1.17, 1.2), title='Clusters')
plt.show()
Appreciate if anyone helps me how can I set the size for sns.scatterplot because my dataset is huge, every time I run my code, it takes a lot of time to execute!