2015-06-18 93 views
1

我正在使用函數timePlot(來自openair),並且我想修正y軸的極限。爲此,我應該選擇auto.text=FALSE,但我不知道如何爲每個物種指定值。例如:更改y軸限制timePlot

 require(openair) 

     timePlot(selectByDate(mydata, year = 1998, month = 1), pollutant = 
       + c("nox", "no2"), 
       y.relation="free",lwd = c(1, 2),lty=c(1,1),auto.text=FALSE) 

所以,如果我想定義氮氧化物的限制讓我們說,0和500爲NO2 0.80。(只是更改數值),我怎麼能這樣做呢? 任何建議?

在此先感謝!

+0

什麼是'mydata'?這是不可重現的。 – nrussell

+0

@nrussell'mydata'在這種情況下實際上是可重現的。它附帶包 - 'data(mydata)'LOL。這是百萬分之一的時候,有時會說「mydata」,它實際上是可重現的。 –

+0

@ Hack-R然後OP應該在問題中包含這個...... – nrussell

回答

0

如果你願意繪製他們一次一個,那麼你可以通過從latticeylim選項:

require(openair) 
data(mydata) 
timePlot(selectByDate(mydata, year = 1998, month = 1), pollutant = c("nox"), y.relation="free", 
     lwd = c(1, 2),lty=c(1,1),auto.text=FALSE, ylim = c(0, 500)) 

timePlot(selectByDate(mydata, year = 1998, month = 1), pollutant = c("no2"), y.relation="free", 
     lwd = c(1, 2),lty=c(1,1),auto.text=FALSE, ylim = c(0, 80)) 
+0

謝謝,我明白了..但是,沒有選項可以在同一時間內指定此策略嗎?因爲我想在同一個地塊上繪製幾個物種(比較它們),而且如果我必須每次都寫timePlot(對於每個物種),這是非常煩人的 – user3231352

+0

沒有這個選項,只能接受'ylim'在'timePlot'中有1個長度爲2的函數 - 雖然你可以得到這個函數的源代碼,並重寫它一下。就個人而言,我只需複製並粘貼'timePlot'函數,更改每個圖的限制/污染物,然後將它們結合起來,然而您喜歡它們,無論是R還是GIMP等圖像編輯程序中的更好。 –