% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_fun.R
\name{plot_tiles}
\alias{plot_tiles}
\title{Plot n-by-n tiles.}
\usage{
plot_tiles(
  n = NA,
  pal = pal_ds4psy,
  sort = TRUE,
  borders = TRUE,
  border_col = "black",
  border_size = 0.2,
  lbl_tiles = FALSE,
  lbl_title = FALSE,
  polar = FALSE,
  rseed = NA,
  save = FALSE,
  save_path = "images/tiles",
  prefix = "",
  suffix = ""
)
}
\arguments{
\item{n}{Basic number of tiles (on either side).}

\item{pal}{Color palette (automatically extended to \code{n x n} colors). 
Default: \code{pal = \link{pal_ds4psy}}.}

\item{sort}{Boolean: Sort tiles? 
Default: \code{sort = TRUE} (i.e., sorted tiles).}

\item{borders}{Boolean: Add borders to tiles? 
Default: \code{borders = TRUE} (i.e., use borders).}

\item{border_col}{Color of borders (if \code{borders = TRUE}). 
Default: \code{border_col = "black"}.}

\item{border_size}{Size of borders (if \code{borders = TRUE}). 
Default: \code{border_size = 0.2}.}

\item{lbl_tiles}{Boolean: Add numeric labels to tiles? 
Default: \code{lbl_tiles = FALSE} (i.e., no labels).}

\item{lbl_title}{Boolean: Add numeric label (of n) to plot? 
Default: \code{lbl_title = FALSE} (i.e., no title).}

\item{polar}{Boolean: Plot on polar coordinates? 
Default: \code{polar = FALSE} (i.e., using fixed coordinates).}

\item{rseed}{Random seed (number).
Default: \code{rseed = NA} (using random seed).}

\item{save}{Boolean: Save plot as png file? 
Default: \code{save = FALSE}.}

\item{save_path}{Path to save plot (if \code{save = TRUE}).
Default: \code{save_path = "images/tiles"}.}

\item{prefix}{Prefix to plot name (if \code{save = TRUE}).
Default: \code{prefix = ""}.}

\item{suffix}{Suffix to plot name (if \code{save = TRUE}).
Default: \code{suffix = ""}.}
}
\description{
\code{plot_tiles} plots an area of \code{n-by-n} tiles 
on fixed or polar coordinates.
}
\examples{
# (1) Tile plot:
plot_tiles()  # default plot (random n, with borders, no labels)

plot_tiles(n = 4, sort = FALSE)      # random order
plot_tiles(n = 6, borders = FALSE)   # no borders
plot_tiles(n = 8, lbl_tiles = TRUE,  # with tile + 
           lbl_title = TRUE)         # title labels 

# Set colors: 
plot_tiles(n = 4, pal = c("orange", "white", "firebrick"),
           lbl_tiles = TRUE, lbl_title = TRUE,
           sort = TRUE)
plot_tiles(n = 6, sort = FALSE, border_col = "white", border_size = 2)

# Fixed rseed:
plot_tiles(n = 4, sort = FALSE, borders = FALSE, 
           lbl_tiles = TRUE, lbl_title = TRUE, 
           rseed = 101)

# (2) polar plot:  
plot_tiles(polar = TRUE)  # default polar plot (with borders, no labels)

plot_tiles(n = 4, polar = TRUE, sort = FALSE)   # random order
plot_tiles(n = 6, polar = TRUE, sort = TRUE,    # sorted and with 
           lbl_tiles = TRUE, lbl_title = TRUE)  # tile + title labels 
plot_tiles(n = 4, sort = FALSE, borders = TRUE,  
           border_col = "white", border_size = 2, 
           polar = TRUE, rseed = 132)           # fixed rseed
 
}
\seealso{
\code{\link{pal_ds4psy}} for default color palette.

Other plot functions: 
\code{\link{plot_charmap}()},
\code{\link{plot_chars}()},
\code{\link{plot_circ_points}()},
\code{\link{plot_fn}()},
\code{\link{plot_fun}()},
\code{\link{plot_n}()},
\code{\link{plot_text}()},
\code{\link{theme_clean}()},
\code{\link{theme_ds4psy}()},
\code{\link{theme_empty}()}
}
\concept{plot functions}
