使用par(mfrow = c())在一个图中绘制多个填充.contour图 [英] Multiple filled.contour plots in one graph using with par(mfrow=c())
问题描述
我正在试图构造一个由2-3 filled.contour
相邻的图。所有地块的色阶都是一样的,我只想要一个z值的关键地块。我很难用 par(mfrow = c(1,3))
执行此操作。示例代码:
x < - 1:5
y< - 1:5
z< - matrix (x,y,+),nrow = 5)
filled.contour(x,y,z)
filled.contour(x,y,z,color.palette = rainbow)
z2 < - z
z2 [5,5] < - Inf
filled.contour(x,y,z2,col =彩虹(200),nlevels = 200)
只有一个z值的颜色键可以将这些图中的2-3个堆在一起吗?我可以在GIMP中执行此操作,但是我想知道它是否可以在本地运行。
不,我不认为这是可行的 filled.contour
。
虽然扩展名已经为您编写。 要在这里找到,这里和 here 和这里的图例代码。使用这些代码我制作了:
I am trying to construct a graph consisting of 2-3 filled.contour
plots next to each other. The color scale is the same for all plots, and I would like only one z value key plot. I am having difficulties to do this with par(mfrow=c(1,3))
Example code:
x <- 1:5
y <- 1:5
z <- matrix(outer(x,y,"+"),nrow=5)
filled.contour(x,y,z)
filled.contour(x,y,z,color.palette=rainbow)
z2 <- z
z2[5,5] <- Inf
filled.contour(x,y,z2,col=rainbow(200),nlevels=200)
Is it possible to stack 2-3 of these plots next to each other with only one z value color key? I can do this in GIMP but I was wondering if it is natively in R possible.
No I do not think this is possible in filled.contour
.
Although extensions have been written for you already. To be found here, here and here and a legend code here.
Using those codes I produced:
这篇关于使用par(mfrow = c())在一个图中绘制多个填充.contour图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!