5

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?

2
  • 3
    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. Commented Jun 15, 2020 at 15:43
  • 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.
    – user265883
    Commented Jun 24, 2020 at 12:54

0

Browse other questions tagged or ask your own question.