Error `check_aesthetics()

Hello, I'm having some issues with the code that creates .png images of the water temperature. More specific I found out that error 'check_aesthetics() occurs after that lines:
'''
gp <- gp + new_scale_fill() +
geom_label(data = vode_df_out[!vode_df_out$ime%in%specialS,], aes(lon, lat, label=sprintf("%s", format (round(Temperatura, digits = 1), decimal.mark=",")), fill=Temperatura), vjust = 0, nudge_y = -1500, size=5, label.padding=unit(0.15,"lines"), label.r = unit(0.35, "lines"),label.size=0) +
geom_label(data = vode_df_out[vode_df_out$ime%in%specialS,], aes(lon + xS, lat +yS,label=sprintf("%s", format (round(Temperatura, digits = 1), decimal.mark=",")), fill=Temperatura), vjust = 0, nudge_y = -1500, size=5, label.padding=unit(0.15,"lines"), label.r = unit(0.35, "lines"),label.size=0) +
scale_fill_viridis(alpha = 1,begin = 0,end = 1,direction = 1,discrete = FALSE, option = "H", values=vals, name = expression(Temperatura), limits = c(0, 30), oob = scales::squish, guide = guide_colourbar(order = 1, label.position = "left", barwidth=2, barheight=11, label.theme = element_text(colour = "black", angle = 0, size=10), title.theme = element_text(size=12))) +
new_scale_fill() +
geom_text(data = vode_df_out[!(vode_df_out$ime%in%special1 | vode_df_out$ime%in%specialS),], aes(lon,lat, label=paste0(reka,"\n",ime)), vjust = 0, hjust=0.5, nudge_y = 5000, nudge_x=0, colour="black", size=3.5, lineheight=0.8) +
geom_text(data = vode_df_out[vode_df_out$ime%in%special1,], aes(lon,lat, label=paste0(reka,"\n",ime)), vjust = 0.5, hjust=0.5, nudge_y=-5500, nudge_x=0, colour="black", size=3.5, lineheight=0.8) +
geom_text(data = vode_df_out[vode_df_out$ime%in%specialS,], aes(lon,lat, label=paste0(reka,"\n",ime)), vjust = vjustS, hjust=0.5, nudge_y=yS_name, nudge_x=xS_name, colour="black", size=3.5, lineheight=0.8) +
ggtitle(paste0("")) +
theme(plot.caption=element_text(color="#666666",size=12, hjust=0.1, margin=margin(0,0,0,0))) +
theme(plot.background = element_rect(fill = "white", colour=NA), plot.margin=unit(c(0,0,1,0),"cm")) +
theme(legend.position = c(0.82, 0.25)) +
labs(caption=paste(" Temperatura vode (°C) - 6. avgust 2022 ob 12. uri"))
'''

Any help would be appreciated, and I can also add whole script.

Hi!

To help us help you, could you please prepare a minimal reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.