2016-06-23 7 views
3

グリッド線を正しく取得するために、以下の画像を使用しています。タービンのパワー曲線をプロットするbReezeパッケージの使用:出力プロットR、bReezeパッケージのグリッド線の整列

library(bReeze) 
pc=pc("Vestas_V90_1.8MW.wtg") 
plot(pc) 

ことである:

Output Vestas v90 power curve

しかしの助けを借りてプロットにグリッド線を割り当てる:

grid() 

イメージを与える:

Output with grid lines

歪んだグリッド線を修正する方法についてのご意見はありますか?

答えて

1

あなたは plot(pc)xlimylimとしてpar(mar = c(5, 5, 1, 5)やお菓子data.rangesを使用して、いくつかの引数に(例えば、傷、XLIM、YLimプロパティ)を得ていない場合。これらのプロパティを使用すると、grid()を使用できます。

pc.data = pc("Vestas_V90_1.8MW.wtg") 
plot(pc.data) 
par(mar = c(5, 5, 1, 5), new=T)       # set par() and order to overlay 
plot(pc.data[[1]], pc.data[[2]], type="n", ann=F, axes=F) # nothing but setting xy-cordinates 
grid(NULL)          # here, the same xy-coordinates are reproduced 

# If you want to adjust grid lines to right y-axis, use berow code 
: 
par(mar = c(5, 5, 1, 5), new=T)     # plot(pc) uses right ylim=c(0,1) 
plot(pc.data[[1]], pc.data[[2]], ylim=c(0,1), type="n", ann=F, axes=F) 
grid(NULL)          # the xy(right)-coordinates are reproduced 

# If you plot pc.object having single y-axis, use mar = c(5, 5, 1, 1) 

enter image description here

+0

コードには、グラフが表示されていない最後の行を除いて正常に動作します。 – SamAct

+0

@SamAct申し訳ありません、私は編集しました。 – cuttlefish44

関連する問題