I have a simple R plot (i.e. plot(object)) and would like to suppress the legend. I am not, and cannot, use ggplot - how do I prevent R adding a legend to the plot?
Hi. Base R plots don't usually have a legend unless you specify one. However, plot is a generic function and will behave differently for different types of R object; some special classes might include a legend in their implementation of plot. Therefore, removing the legend depends entirely on what type of object you are plotting. You haven't included that information in your question, so there is no way to help you unless you include the object class or the code that produced the object you are plotting.
Thanks Allan - this answered my question. I realised I was plotting a specalist object from a package and when I checked the documentation found that I needed to set legend=FALSE.
plot
. Therefore, removing the legend depends entirely on what type of object you are plotting. You haven't included that information in your question, so there is no way to help you unless you include the object class or the code that produced the object you are plotting.