% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/future_climate.R
\name{plot_cmip6}
\alias{plot_cmip6}
\title{Download and plot essential climate data}
\usage{
plot_cmip6(
  dataset = get_cmip6(),
  palette = "Spectral",
  xlim = NULL,
  ylim = NULL,
  country = NULL,
  state = NULL,
  mask = TRUE,
  print = TRUE
)
}
\arguments{
\item{dataset}{Name of the tibble generated by \code{get_cmip6}}

\item{palette}{(string) Color palette name passed to RColorBrewer. Defaults to
"Spectral" reversed for temperature-type variables.}

\item{xlim, ylim}{(numeric) Optional two-element longitude/latitude bounds to
zoom the map to a region, e.g. \code{xlim = c(-130, -60), ylim = c(20, 70)}.}

\item{country}{(string) Optional country name or ISO 3166-1 alpha-3 code to
zoom the map to that country. Requires the \code{geodata} package.}

\item{state}{(string) Optional state/province name (admin-1), used together
with \code{country} to zoom to a subnational region, e.g.
\code{country = "MEX", state = "Sonora"}. Requires the \code{geodata} package.}

\item{mask}{(boolean) If \code{country} is given, blank cells outside the
country border, defaults to TRUE.}

\item{print}{(boolean) Display map, defaults to TRUE.}
}
\value{
Invisibly returns a ggplot2 object with the projection map.
}
\description{
Plots gridded CMIP6 climate projections retrieved using \code{get_cmip6()} with ggplot2.
}
\details{
\code{plot_cmip6} returns a pre-defined ggplot2 world map of projected
values. Regions may be selected by coordinates (\code{xlim}/\code{ylim}),
by country, or by state/province. Users may further modify the output chart.
}
\examples{
\donttest{
proj <- get_cmip6()
plot_cmip6(proj)
#
# Zoom to the contiguous United States. Explicit xlim/ylim override the
# country's bounding box, excluding Alaska and Hawaii from the view:
plot_cmip6(proj, country = 'USA', xlim = c(-125, -66), ylim = c(24, 50))
#
# Or zoom to a single state:
plot_cmip6(proj, country = 'MEX', state = 'Sonora') }

}
