
--- choropleth.py
+++ choropleth.py
... | ... | @@ -187,11 +187,7 @@ |
187 | 187 |
|
188 | 188 |
# fig.show() # debug |
189 | 189 |
if save: |
190 |
- # slicing static image because there is no way to adjust geojson object there. |
|
191 |
- img = plotly_fig2array(fig, scale) |
|
192 |
- img = img[:, 460*scale : 1500*scale] |
|
193 |
- p = f"{save_dir}" |
|
194 |
- cv2.imwrite(p, cv2.cvtColor(img, cv2.COLOR_RGB2BGR)) |
|
190 |
+ # because plotly does not have any methods to adjust geojson object. |
|
195 | 191 |
fig.update_layout( |
196 | 192 |
title=dict( |
197 | 193 |
yanchor="top", |
... | ... | @@ -202,6 +198,12 @@ |
202 | 198 |
font_color="Black" |
203 | 199 |
), |
204 | 200 |
) |
201 |
+ # slicing static image because there is no way to adjust geojson object there. |
|
202 |
+ img = plotly_fig2array(fig, scale) |
|
203 |
+ img = img[:, 460*scale : 1500*scale] |
|
204 |
+ p = f"{save_dir}" |
|
205 |
+ cv2.imwrite(p, cv2.cvtColor(img, cv2.COLOR_RGB2BGR)) |
|
206 |
+ |
|
205 | 207 |
print(f"saved at : {p}") |
206 | 208 |
else: |
207 | 209 |
return fig |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?