% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vis_surface_background.R
\name{force.to.range}
\alias{force.to.range}
\title{Change data to ensure requested data_range.}
\usage{
force.to.range(x, data_range, allow_append = FALSE)
}
\arguments{
\item{x}{numerical vector, the input data.}

\item{data_range}{numerical vector of length 2, the range into which to force the data values in 'x'. If \code{NULL}, the input data in 'x' is returned as is.}

\item{allow_append}{logical, whether to allow adding of more extreme data values. Allows a range larger than the data range. If set to \code{TRUE}, you will have to remove the extra values from the colors after generation of the colormap.}
}
\value{
Modified version of x. The data will be clamped and / or at most 2 values may be appended to x.
}
\description{
Change data to ensure requested data_range.
}
\note{
This is an artificial modification of the data used for plotting a colormap with a fixed range.
}
\keyword{internal}
