geo_df['center'] = geo_df.geometry.centroid
geo_df['center_lon'] = geo_df.center.x
geo_df['center_lat'] = geo_df.center.y
(
ggplot(geo_df)
+ geom_map(aes(fill="costo_per_km2"), color="black", size=0.1)
+ scale_fill_cmap(cmap_name="YlOrRd")
+ geom_label(
aes("center_lon", "center_lat", label="DEN_REGIONE"),
size=6,
color="black",
boxcolor="white",
label_size=0.7,
label_padding=0.25,
adjust_text={"max_move": 1}
)
+ labs(fill="Costo €/km²")
+ theme(
panel_background=element_rect(fill="white"),
panel_grid=element_blank(),
axis_text=element_blank(),
axis_ticks=element_blank(),
axis_title=element_blank(),
)
)
I would like to not have the labels overlap. But when I add adjust_text the labels all go out of the graph.
This seems like a bug.
Hi,
I'm using this input geojson and this code
I would like to not have the labels overlap. But when I add adjust_text the labels all go out of the graph.
This seems like a bug.
Thanks