【发布时间】:2019-11-08 14:32:01
【问题描述】:
我有如下可视化代码:
for cluster in ready_couples_2.cluster.unique():
sns.set(rc={'figure.figsize':(11.7,8.27)})
# mask the cluster of interest
is_cluster = ready_couples_2.cluster.eq(cluster)
ax = ready_couples_2[~is_cluster].plot.scatter(x='longitude',y='latitude', c='gray')
ax = sns.scatterplot(data=ready_couples_2[is_cluster],
x='longitude',
y='latitude',
hue='id_easy',
ax=ax)
ax.legend_.remove()
figure = ax.get_figure()
figure.savefig('test.png', dpi=500)
plt.show()
但是figure 只保存了给定地块中的一个地块。如何将它们全部保存或如何在绘图时定义 DPI?
【问题讨论】:
标签: python matplotlib seaborn dpi