Giter Site home page Giter Site logo

Comments (5)

davidhodge931 avatar davidhodge931 commented on June 15, 2024

Not really required, as can do everything other than colour palettes with:

set_theme()
weave_geom_aes()
weave_annotate_aes()

Colour palettes can be done with options()

from ggblanket.

davidhodge931 avatar davidhodge931 commented on June 15, 2024
library(tidyverse)
library(ggblanket)
library(palmerpenguins)

set_blanket()
ggblanket:::set_ggplot()

penguins |>
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    col = species,
  )
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm, y = body_mass_g, colour = species))
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2024-04-18 with reprex v2.1.0

from ggblanket.

davidhodge931 avatar davidhodge931 commented on June 15, 2024
library(tidyverse)
library(ggblanket)
library(palmerpenguins)

set_blanket()
ggblanket:::set_ggplot(dark_mode_r())

penguins |>
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    col = species,
  )
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm, y = body_mass_g, colour = species))
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2024-04-18 with reprex v2.1.0

from ggblanket.

davidhodge931 avatar davidhodge931 commented on June 15, 2024

Merge with set_blanket - because weave_geom_aes and weave_annotate_aes affect ggplot2 anyway.. Then might as well make it all affect ggplot2

from ggblanket.

davidhodge931 avatar davidhodge931 commented on June 15, 2024
library(tidyverse)
library(ggblanket)
library(palmerpenguins)

weave_mode(new = dark_mode_r())
weave_geom_aes(colour = pink)
weave_annotate_aes(colour = darkness[2])
weave_col_palette(discrete = c(pink, blue, navy), 
                  continuous = viridis::rocket(n = 20))
weave_theme(new = dark_mode_r(orientation = "x"))

# set_blanket(
#   mode = dark_mode_r(),
#   geom_colour = pink,
#   annotate_colour = darkness[2],
#   col_palette_discrete = c(pink, blue, navy),
#   col_palette_continuous = viridis::rocket(n = 20),
#   theme = dark_mode_r(orientation = "x"),
# )

penguins |> 
  gg_histogram(
    x = flipper_length_mm,
    col = species,
    x_title = "Flipper length (mm)",
  ) +
  geom_vline(xintercept = 200)

penguins |> 
  ggplot() +
  geom_histogram(aes(x = flipper_length_mm, 
                     col = species, 
                     fill = species, 
                     )
                 ) +
  geom_vline(xintercept = 200) +
  scale_y_continuous(expand = c(0, 0), 
                     breaks = scales::breaks_pretty(6),
                     # limits = c(0, 30)
                     ) +
  labs(x = "Flipper length (mm)", 
       y = "Count", 
       colour ="Species", 
       fill = "Species")


penguins |> 
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    col = bill_depth_mm,
    x_title = "Flipper length (mm)",
  ) +
  geom_vline(xintercept = 200)

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, 
                 y = body_mass_g,
                     col = bill_depth_mm, 
                     fill = bill_depth_mm, 
  )
  ) +
  geom_vline(xintercept = 200) +
  scale_y_continuous(expand = c(0, 0), 
                     breaks = scales::breaks_pretty(6),
                     # limits = c(0, 30)
                     ) +
  labs(x = "Flipper length (mm)", 
       y = "Count", 
       colour ="Species", 
       fill = "Species")


penguins |> 
  gg_point(
    x = flipper_length_mm,
    y = body_mass_g,
    x_title = "Flipper length (mm)",
  ) +
  geom_vline(xintercept = 200)

penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, 
                 y = body_mass_g,
  )
  ) +
  geom_vline(xintercept = 200) +
  scale_y_continuous(expand = c(0, 0), 
                     breaks = scales::breaks_pretty(6),
                     # limits = c(0, 30)
  ) +
  labs(x = "Flipper length (mm)", 
       y = "Count", 
       colour ="Species", 
       fill = "Species")

from ggblanket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.