Reputation: 13
Let`s assume I have two different plots with similar dimensions:
First:
library(fields)
x <- 1:10
y <- 1:15
z <- outer(x, y, "+")
image.plot(x, y, z)
Second:
library(fields)
x <- 5:15
y <- 5:20
z <- outer(x, y, "+")
image.plot(x, y, z)
I`d like to match the color gradients of both plots with yellow at z=15.
I appreciate your help
Upvotes: 1
Views: 145
Reputation: 206197
If you want to use the same color breaks for each of your plots, you should manually specify them. For example
image.plot(x, y, z, breaks=seq(0, 35, length.out=65), col=rainbow(64))
This will fix the color scale from 0 to 35. Or you could set whatever range you like.
Upvotes: 1