Hi, the error would suggest that the plot_map object that you defined earlier isn't being saved. Maybe there is an error with that?
plot_map
A reproducible example would be useful (we don't have your dataset).