Skip to contents

Generates ggplot2 plots with aesthetic elements inspired by Banksy's works.

Usage

style_banksy(
  data,
  x = NULL,
  y = NULL,
  color_var = NULL,
  fill_var = NULL,
  label_var = NULL,
  title = "Datos con la Calle de Banksy",
  subtitle = "Un mensaje subversivo en cada punto",
  caption = "Arte Urbano de Datos",
  plot_type = c("column", "scatter", "line", "map"),
  work_inspired_by = c("girl_with_balloon", "flower_thrower", "rat_graffiti"),
  show_labels = FALSE,
  add_grid_lines = FALSE,
  show_background = TRUE,
  add_glow = FALSE,
  coord_flip = FALSE,
  text_size = 16,
  add_texture = NULL,
  canvas = NULL,
  add_margins = TRUE,
  add_filter = FALSE
)

Arguments

data

A data frame or an sf object.

x

A tidy-evaluated expression specifying the column name for the x-axis (for scatter, line, column plots).

y

A tidy-evaluated expression specifying the column name for the y-axis (for scatter, line, column plots).

color_var

An optional tidy-evaluated expression specifying the column name for color mapping. Defaults to NULL.

fill_var

An optional tidy-evaluated expression specifying the column name for fill mapping (for column charts or map polygons). Defaults to NULL.

label_var

An optional tidy-evaluated expression specifying the column name for text labels (for maps or other plots). Defaults to NULL.

title

The plot title.

subtitle

The plot subtitle.

caption

The plot caption.

plot_type

The type of plot: "scatter", "line", "column", or "map".

work_inspired_by

Specific work for aesthetic inspiration: "girl_with_balloon", "flower_thrower", or "rat_graffiti".

show_labels

Logical, whether to show data labels. Defaults to FALSE.

add_grid_lines

Logical, whether to show major grid lines (only for non-map plots). Defaults to FALSE.

show_background

Logical, whether to show the panel background (for non-map plots). Defaults to TRUE.

add_glow

Logical, whether to add an outer glow effect. Defaults to FALSE.

coord_flip

Logical, whether to flip coordinates in column charts. Defaults to FALSE.

text_size

Base size for text elements (titles, labels, legend). Labels and annotations scale proportionally from this value. Defaults to 16

add_texture

Integer (1–3). Applies visual texture effects to geoms. Default: `NULL`.

canvas

Integer (1–6). Adds canvas-style background image. Default: `NULL`.

add_margins

Logical. Applies margins to plot and labs. Default: `TRUE`.

add_filter

Experimental. Logical. Applies oil effect to the full graph. Default: `FALSE`.

Value

A ggplot2 object.