Skip to content

Commit

Permalink
Merge pull request #189 from Yunuuuu/master
Browse files Browse the repository at this point in the history
fix warning message: deprecated arguments
  • Loading branch information
clauswilke authored Dec 12, 2022
2 parents 555c9ae + b0d381b commit 1f35f38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cowplot
Title: Streamlined Plot Theme and Plot Annotations for 'ggplot2'
Version: 1.1.1
Version: 1.1.2
Authors@R:
person(
given = "Claus O.",
Expand All @@ -22,7 +22,7 @@ BugReports: https://github.com/wilkelab/cowplot/issues
Depends:
R (>= 3.5.0)
Imports:
ggplot2 (> 2.2.1),
ggplot2 (>= 3.4.0),
grid,
gtable,
grDevices,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# cowplot 1.1.2

- fix warning message: deprecated `size` argument in `element_rect()` and `element_line()` (@Yunuuuu, #190)

# cowplot 1.1.1

- Make sure tests don't fail if vdiffr is missing.
Expand Down
22 changes: 11 additions & 11 deletions R/themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ theme_cowplot <- function(font_size = 14, font_family = "", line_size = .5,
# work off of theme_grey just in case some new theme element comes along
theme_grey(base_size = font_size, base_family = font_family) %+replace%
theme(
line = element_line(color = "black", size = line_size, linetype = 1, lineend = "butt"),
rect = element_rect(fill = NA, color = NA, size = line_size, linetype = 1),
line = element_line(color = "black", linewidth = line_size, linetype = 1, lineend = "butt"),
rect = element_rect(fill = NA, color = NA, linewidth = line_size, linetype = 1),
text = element_text(family = font_family, face = "plain", color = "black",
size = font_size, hjust = 0.5, vjust = 0.5, angle = 0, lineheight = .9,
margin = margin(), debug = FALSE),

axis.line = element_line(color = "black", size = line_size, lineend = "square"),
axis.line = element_line(color = "black", linewidth = line_size, lineend = "square"),
axis.line.x = NULL,
axis.line.y = NULL,
axis.text = element_text(color = "black", size = small_size),
axis.text.x = element_text(margin = margin(t = small_size / 4), vjust = 1),
axis.text.x.top = element_text(margin = margin(b = small_size / 4), vjust = 0),
axis.text.y = element_text(margin = margin(r = small_size / 4), hjust = 1),
axis.text.y.right = element_text(margin = margin(l = small_size / 4), hjust = 0),
axis.ticks = element_line(color = "black", size = line_size),
axis.ticks = element_line(color = "black", linewidth = line_size),
axis.ticks.length = unit(half_line / 2, "pt"),
axis.title.x = element_text(
margin = margin(t = half_line / 2),
Expand Down Expand Up @@ -204,11 +204,11 @@ theme_minimal_grid <- function(font_size = 14, font_family = "", line_size = .5,
theme(
# make grid lines
panel.grid = element_line(color = color,
size = line_size),
linewidth = line_size),
panel.grid.minor = element_blank(),

# adjust axis tickmarks
axis.ticks = element_line(color = color, size = line_size),
axis.ticks = element_line(color = color, linewidth = line_size),

# no x or y axis lines
axis.line.x = element_blank(),
Expand Down Expand Up @@ -239,7 +239,7 @@ theme_minimal_vgrid <- function(font_size = 14, font_family = "", line_size = .5
panel.grid.major.y = element_blank(),

# add a y axis line
axis.line.y = element_line(color = color, size = line_size),
axis.line.y = element_line(color = color, linewidth = line_size),

complete = TRUE
)
Expand All @@ -263,7 +263,7 @@ theme_minimal_hgrid <- function(font_size = 14, font_family = "", line_size = .5
panel.grid.major.x = element_blank(),

# add a x axis line
axis.line.x = element_line(color = color, size = line_size),
axis.line.x = element_line(color = color, linewidth = line_size),

complete = TRUE
)
Expand Down Expand Up @@ -465,7 +465,7 @@ background_grid <- function(major = c("xy", "x", "y", "only_minor", "none"),
t <- theme(
panel.grid = element_line(
color = color.major,
size = size.major,
linewidth = size.major,
linetype = 1,
lineend = "butt"
),
Expand All @@ -474,7 +474,7 @@ background_grid <- function(major = c("xy", "x", "y", "only_minor", "none"),
panel.grid.major.y = NULL,
panel.grid.minor = element_line(
color = color.minor,
size = size.minor,
linewidth = size.minor,
linetype = 1,
lineend = "butt"
),
Expand Down Expand Up @@ -525,6 +525,6 @@ panel_border <- function(color = 'grey85', size = 1, linetype = 1, remove = FALS
if (remove){
return(theme(panel.border = element_blank()))
}
theme(panel.border = element_rect(color = color, fill=NA, linetype = linetype, size = size))
theme(panel.border = element_rect(color = color, fill = NA, linetype = linetype, linewidth = size))
}

0 comments on commit 1f35f38

Please sign in to comment.