在R,bReeze包中对齐网格线 [英] Aligning grid lines in R, bReeze package
本文介绍了在R,bReeze包中对齐网格线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使下图中的网格线正常工作.使用bReeze
软件包通过以下方式绘制涡轮机的功率曲线:
I am trying to get grid lines work properly in the image below. Using the bReeze
package to plot the power curves of the turbines with:
library(bReeze)
pc=pc("Vestas_V90_1.8MW.wtg")
plot(pc)
输出图为:
但借助以下方法将网格线分配给绘图:
but assigning grid lines to the plot with the help of:
grid()
给出以下图片:
关于如何修复扭曲的网格线的任何建议?
Any suggestions on how to fix the distorted grid lines?
推荐答案
如果您不提供一些参数(例如mar,xlim,ylim),
plot(pc)
使用par(mar = c(5, 5, 1, 5)
并将data.ranges视为xlim
和ylim
.通过使用这些属性,您可以使用grid()
.
If you don't give some arguments (e.g., mar, xlim, ylim),
plot(pc)
uses par(mar = c(5, 5, 1, 5)
and treats data.ranges as xlim
and ylim
. By using these properties, you can use 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)
这篇关于在R,bReeze包中对齐网格线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文