Theme Selector for ggplot2
Authors: Santiago García Sánchez
Abstract: A Shiny app that enables users to upload a plot created with ggplot2 and dynamically switch between a variety of themes. Nearly 50 different packages with complete themes are currently included. Additionally, color palettes from over 70 packages can also be applied.
Full Description: The primary goal of this Shiny App is to simplify the task of selecting a ggplot2 theme by enabling users to upload a plot from their computers and dynamically switch between various packages and themes.
The app consists of a sidebar layout, with plots displayed on the right and four tabs on the left:
- Data: This tab contains a
fileInput
widget that allows users to upload a ggplot2 object from the computer. The plot must have been previously created with ggplot2 and saved as an .Rdata file. Alternatively, users can choose from five different sample plots provided by the app (created with data from the palmerpenguins package). - Theme: Includes a
pickerInput
widget with nearly 50 packages to choose from. All packages are available on either CRAN or GitHub and include one or more complete themes. Below this, a secondpickerInput
widget displays all the themes available within the selected package. As users switch between these options, the plot on the right dynamically updates to reflect the applied theme. Descriptions are provided for all packages and most themes. Finally, an APA-style citation for the currently selected package is shown. - Palettes: Similar to the previous tab, a
pickerInput
widget allows users to select from nearly 80 packages containing color palettes. Two additionalpickerInput
widgets display all available palettes for the fill and color aesthetics. Like themes, palettes are applied dynamically to the plot as they are selected. The user must ensure that the type of palette chosen corresponds to the type of variable in the plot (discrete or continuous); otherwise, the app will show an error. As before, descriptions and citations are also provided. - Size: Contains two
numericInput
widgets for adjusting the height and width of the plot.
This video demonstrates an example of creating a plot with ggplot2, uploading it to the app, and customizing it.
Shiny app: https://sgs2000.shinyapps.io/themeselector/
Repo: GitHub - SGS2000/ggplot2-theme-selector: Selector de temas para ggplot2
Thumbnail:
Full image: