Is there a way to remove the legend/colourbar from a density plot?
library(spatstat)
plot(density(hamster))
I don't see any arguments to help with this in the documentation https://www.rdocumentation.org/packages/spatstat.geom/versions/3.6-1/topics/plot.colourmap
Your command doesn't call plot.colourmap. It calls plot.im since the object has class "im". And the help page of that function says you can set the "ribbon" argument to FALSE if you don't want the colorbar legend (the ribbon).
plot(density(hamster), ribbon=FALSE)