Skip to contents

Creates high-impact, visually appealing plots using `ggplot2`, supporting multiple plot types (`"column"`, `"scatter"`, `"line"`, and `"map"`), modern color palettes, Google Fonts, and advanced visual effects like glow, shadow, and background blur.

Usage

plot_guapo(
  data,
  x = NULL,
  y = NULL,
  color_var = NULL,
  fill_var = NULL,
  label_var = NULL,
  title = "Visualización de Datos Impactante",
  subtitle = "Con Estilo y Diseño Avanzado",
  caption = "Generado con plot_guapo",
  plot_type = c("column", "scatter", "line", "map"),
  palette_name = c("guapo", "guapero", "guapon", "guapisimo"),
  font_title_name = "Orbitron",
  font_body_name = "Poppins",
  show_labels = FALSE,
  coord_flip = FALSE,
  show_baseline = FALSE,
  highlight_values = NULL,
  highlight_color = "#FFD700",
  facet_var = NULL,
  dark_mode = FALSE,
  apply_shadow = FALSE,
  apply_glow = FALSE,
  apply_blur_background = FALSE,
  gradient_fill = FALSE,
  base_alpha = 0.8,
  geom_size = 3,
  geom_stroke = 0.5,
  text_size = 20
)

Arguments

data

A data frame (`data.frame`) or an `sf` object (for `plot_type = "map"`).

x

Variable for the x-axis (unquoted).

y

Variable for the y-axis (unquoted).

color_var

Variable used for color aesthetics.

fill_var

Variable used for fill aesthetics.

label_var

Variable used for text labels.

title

Main plot title.

subtitle

Subtitle of the plot.

caption

Caption text displayed below the plot.

plot_type

Type of plot: `"column"`, `"scatter"`, `"line"`, or `"map"`.

palette_name

Color palette to use: `"guapo"`, `"guapero"`, `"guapon"`, or `"guapisimo"`.

font_title_name

Font for the title (Google Fonts, default: `"Orbitron"`).

font_body_name

Font for the body and labels (default: `"Poppins"`).

show_labels

Logical. If `TRUE`, displays text labels on bars or points.

coord_flip

Logical. If `TRUE`, flips x and y axes (useful for bar plots).

show_baseline

Logical. If `TRUE`, draws a baseline at y = 0 for column, scatter and line plots.

highlight_values

A vector of values to highlight (based on `color_var` or `fill_var`).

highlight_color

Color used for highlighting specific values.

facet_var

Variable used for faceting (unquoted).

dark_mode

Logical. If `TRUE`, applies a dark-themed background.

apply_shadow

Logical. If `TRUE`, applies a shadow effect to geoms.

apply_glow

Logical. If `TRUE`, applies a glow effect to geoms.

apply_blur_background

Logical. If `TRUE`, adds a blurred background to the plot.

gradient_fill

Logical. If `TRUE`, fills bars/points with a color gradient instead of solid colors.

base_alpha

Alpha transparency applied to geoms (default: 0.8).

geom_size

Size of geom elements (points, lines, or bars).

geom_stroke

Stroke width for geoms (e.g., outline of points).

text_size

Base size for plot text (titles, labels, etc.).

Value

A stylized `ggplot` object.