add_plot_attributes: Complete figure with its attributes

View source: R/data_plot.R

add_plot_attributesR Documentation

Complete figure with its attributes

Description

The data_plot() function usually stores information (such as title, axes labels, etc.) as attributes, while add_plot_attributes() adds this information to the plot.

Usage

add_plot_attributes(x)

Arguments

x

An object.

Examples

## Not run: 
library(rstanarm)
library(bayestestR)
library(see)
library(ggplot2)

model <- stan_glm(
  Sepal.Length ~ Petal.Width + Species + Sepal.Width,
  data = iris,
  chains = 2, iter = 200
)

result <- hdi(model, ci = c(0.5, 0.75, 0.9, 0.95))
data <- data_plot(result, data = model)

p <- ggplot(
  data,
  aes(x = x, y = y, height = height, group = y, fill = fill)
) +
  ggridges::geom_ridgeline_gradient()

p
p + add_plot_attributes(data)

## End(Not run)

see documentation built on March 31, 2022, 5:07 p.m.

Related to add_plot_attributes in see...