传说fill.contour情节

时间:2018-04-17 09:22:00

标签: r

我正在尝试使用filled.contour创建轮廓图,我想更改图例标题和标签的大小以及图例本身的大小。我已经有了我的数据代码,这与火山示例非常相似(更容易复制)。

data(volcano)
filled.contour(volcano, color = terrain.colors, asp = 1)# simple

x <- 10*1:nrow(volcano)
y <- 10*1:ncol(volcano)
filled.contour(x, y, volcano, color = terrain.colors,
               plot.title = title(main = "The Topography of Maunga Whau",
                                  xlab = "Meters North", ylab = "Meters West"),
               plot.axes = { axis(1, seq(100, 800, by = 100))
                 axis(2, seq(100, 600, by = 100)) },
               key.title = title(main="Height\n(meters)"),
               key.axes = axis(4, seq(90, 190, by = 10),asp=1))# maybe also asp=1

我尝试添加cex和pch参数,但似乎无效。

key.title = title(main="Height\n(meters)",cex=0.5,pch = 1)

建议将不胜感激。

谢谢。

1 个答案:

答案 0 :(得分:0)

par(cex.main)plot.title内使用key.title

filled.contour(x, y, volcano, color = terrain.colors,
               plot.title = {par(cex.main=1);title(main = "The Topography of Maunga Whau",
                                  xlab = "Meters North", ylab = "Meters West")},
               plot.axes = { axis(1, seq(100, 800, by = 100))
                 axis(2, seq(100, 600, by = 100)) },
               key.title = {par(cex.main=0.3);title(main="Height\n(meters)")},
               key.axes = axis(4, seq(90, 190, by = 10),asp=1))# maybe also asp=1

enter image description here