-1

I'd appreciate help on how to remove a legend from a plot. Say we have this:

enter image description here

I want to remove the "PM2.5" and the corresponding red line at the bottom of the plot. I wish it to be blank, the reason for this is because I'm using the print and split functions to create a custom plot showing 3 different monitoring sites for air pollution analysis like this:

enter image description here

I do not wish to have 3 legends, just one at the bottom.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Eyrand
  • 1
  • 3
    hi, please include a [reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) so that we can see how you got your plots – bretauv Feb 01 '20 at 13:25
  • Hi, thing is that I don't know how to do that, but I can tell you how: These plots were produced using the "openair" package. More specifically: timePlot(subset(data, site=="Monitoring site #XX), pollutant="pm2.5", avg.time="day", type="site") – Eyrand Feb 01 '20 at 19:43
  • if the first link didn't help you, maybe check [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Use three backticks ( ` x3) to delimit the text you want to put as code. If you don't know how to make your code reproducible, use some datasets included in R (```iris``` or ```mtcars``` for example), or use ```dput``` on a subset of your data to generate the code necessary to reproduce your data. All of these steps are described in the two links I provided you – bretauv Feb 01 '20 at 19:59

1 Answers1

-1

To turn off the legend of openair's timePlot, set "key" to FALSE.

DFM-1124
  • 25
  • 6