davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
307 stars 113 forks source link

Fix Y-axis scale in timeProp function #305

Closed anhduytran98 closed 1 year ago

anhduytran98 commented 2 years ago

Dear, I want to ask how to manage the same scale of Y-axis in the [Time proportion plots], like this: Thank you very much

InkedwsB InkedWS_D

jack-davison commented 1 year ago

Hello,

You can control the y axis limits by using the ylim argument, which isn't listed in the openair documentation but is passed down to the underlying lattice code. So you could make multiple plots have matching y axes by setting them all to be the same values.

openair::timeProp(openair::mydata, "nox", "wd", "year", ylim = c(0, 100))
#> Warning: 219 missing wind direction line(s) removed

openair::timeProp(openair::mydata, "nox", "wd", "year", ylim = c(0, 200))
#> Warning: 219 missing wind direction line(s) removed

openair::timeProp(openair::mydata, "nox", "wd", "year", ylim = c(0, 300))
#> Warning: 219 missing wind direction line(s) removed

Created on 2023-02-06 with reprex v2.0.2