Skip to content

Commit

Permalink
Update theme_classic() (#5981)
Browse files Browse the repository at this point in the history
* update `theme_classic()`

* accept snapshots

* add news bullet
  • Loading branch information
teunbrand committed Aug 26, 2024
1 parent 3a7ae74 commit 8ca3bbc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
is setup once in total instead of once per group (@teunbrand, #5971)
* `facet_grid(space = "free")` can now be combined with `coord_fixed()`
(@teunbrand, #4584).
* `theme_classic()` now has black ticks and text instead of dark gray. In
addition, `theme_classic()`'s axis line end is `"square"` (@teunbrand, #5978).

# ggplot2 3.5.1

Expand Down
6 changes: 4 additions & 2 deletions R/theme-defaults.R
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,12 @@ theme_classic <- function(base_size = 11, base_family = "",
panel.grid.minor = element_blank(),

# show axes
axis.line = element_line(colour = "black", linewidth = rel(1)),
axis.text = element_text(size = rel(0.8)),
axis.line = element_line(lineend = "square"),
axis.ticks = element_line(),

# simple, black and white strips
strip.background = element_rect(fill = "white", colour = "black", linewidth = rel(2)),
strip.background = element_rect(linewidth = rel(2)),
# NB: size is 1 but clipped, it looks like the 0.5 of the axes

complete = TRUE
Expand Down
44 changes: 22 additions & 22 deletions tests/testthat/_snaps/theme/theme-classic-large.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions tests/testthat/_snaps/theme/theme-classic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ca3bbc

Please sign in to comment.