水平图格子上的正确名称
我正在尝试生成一些水平图的网格。现在我有两个问题。 这是一些示例数据
library(lattice)
require(stats)
attach(environmental)
ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation,
parametric = c("radiation", "wind"), span = 1, degree = 2)
w.marginal <- seq(min(wind), max(wind), length.out = 50)
t.marginal <- seq(min(temperature), max(temperature), length.out = 50)
r.marginal <- seq(min(radiation), max(radiation), length.out = 4)
wtr.marginal <- list(wind = w.marginal, temperature = t.marginal,
radiation = r.marginal)
grid <- expand.grid(wtr.marginal)
grid[, "fit"] <- c(predict(ozo.m, grid))
levelplot(fit ~ wind * temperature | radiation, data = grid,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
这将生成以下图。
1) 我希望每个图的标题不是辐射,而是辐射的值(例如 7,334,...)
2)我想将 x 和 y 轴上的刻度更改为字母而不是当前数字。 (我需要的是 EJOT,而不是 5-10-15-20)
你们能(再次)指出我正确的方向吗?
I'm trying to generate a trellis of some levelplots. Now I got 2 issues.
Here is some sampledata
library(lattice)
require(stats)
attach(environmental)
ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation,
parametric = c("radiation", "wind"), span = 1, degree = 2)
w.marginal <- seq(min(wind), max(wind), length.out = 50)
t.marginal <- seq(min(temperature), max(temperature), length.out = 50)
r.marginal <- seq(min(radiation), max(radiation), length.out = 4)
wtr.marginal <- list(wind = w.marginal, temperature = t.marginal,
radiation = r.marginal)
grid <- expand.grid(wtr.marginal)
grid[, "fit"] <- c(predict(ozo.m, grid))
levelplot(fit ~ wind * temperature | radiation, data = grid,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
This will generate the following plot.
1)
I want the title of every plot not to be radiation, but the value of the radiation (e.g. 7,334,...)
2) I want to change the ticks from the x and y axis to letters instead of the current numbers. (instead of 5-10-15-20 I need E-J-O-T)
Can you guys point me (once again) in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
将用辐射值标记您的图。 scales 参数可用于指定不同的标签。
using
will label your plots with the radiation value. the scales argument can be used to specify different labels.