Хотя я не могу привести ваш пример, я думаю, что понял, что вы имеете в виду, и я думаю, что вы можете настроить это на свой layout(..)
. Глядя на ?image.plot
, есть пример того, что вы хотите - вы используете аргумент breaks
и аргумент lab.breaks
для image.plot
:
# generate an image_variable for demonstration
image_variable <- array(runif(100),dim=c(10,10))
color_plate=c('royalblue4','springgreen4','yellow2','darkred')
library(fields) # for image.plot
# This puts the colour scale marks within the colour bar, not on the boundaries:
# image.plot(image_variable,col=color_plate,zlim=c(0,1),...)
zlim <- c(0,1)
# define colour breaks (they were default spaced evenly):
brks = seq(0,1,length.out=length(color_plate)+1)
# plot:
image.plot(image_variable, zlim=zlim, axes=F,
col=color_plate, breaks=brks, lab.breaks=brks)
Надеюсь, это то, что вы хотели.
Если вы только хотите 0 и 1, это еще проще:
image.plot(image_variable, col=color_plate, zlim=zlim, axes=F,
axis.args=list(at=zlim, labels=zlim))