plot_tiles | R Documentation |
plot_tiles
plots an area of n-by-n
tiles
on fixed or polar coordinates.
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 = ""
)
n |
Basic number of tiles (on either side). |
pal |
Color palette (automatically extended to |
sort |
Boolean: Sort tiles?
Default: |
borders |
Boolean: Add borders to tiles?
Default: |
border_col |
Color of borders (if |
border_size |
Size of borders (if |
lbl_tiles |
Boolean: Add numeric labels to tiles?
Default: |
lbl_title |
Boolean: Add numeric label (of n) to plot?
Default: |
polar |
Boolean: Plot on polar coordinates?
Default: |
rseed |
Random seed (number).
Default: |
save |
Boolean: Save plot as png file?
Default: |
save_path |
Path to save plot (if |
prefix |
Prefix to plot name (if |
suffix |
Suffix to plot name (if |
pal_ds4psy
for default color palette.
Other plot functions:
plot_charmap()
,
plot_chars()
,
plot_fn()
,
plot_fun()
,
plot_n()
,
plot_text()
,
theme_clean()
,
theme_ds4psy()
,
theme_empty()
# (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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.