Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Feb 24, 2024
1 parent ef4e199 commit 892ebe5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions R/guide_rampbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ guide_rampbar = function(..., to = "gray65", available_aes = c("fill_ramp", "col
scale, aesthetic, nbin = 300, reverse = FALSE, alpha = NA,
to = "gray65", ...
) {
limits <- scale$get_limits()
bar <- seq(limits[1], limits[2], length.out = nbin)
limits = scale$get_limits()
bar = seq(limits[1], limits[2], length.out = nbin)
if (length(bar) == 0) {
bar <- unique(limits)
bar = unique(limits)
}
bar <- data_frame(
bar = data_frame(
colour = scale$map(bar),
value = bar,
.size = length(bar)
)
if (reverse) {
bar <- bar[nrow(bar):1, , drop = FALSE]
bar = bar[rev(seq_len(nrow(bar))), , drop = FALSE]
}
bar$colour = alpha(apply_colour_ramp(to, bar$colour), alpha)
bar
Expand Down
25 changes: 13 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ slabinterval_plot = ggplot() +
show.legend = FALSE,
position = position_nudge(y = -0.5)
) +
scale_x_continuous(limits = dists_xlim, expand = c(0,0), breaks = NULL) +
scale_y_discrete(limits = rev, breaks = NULL) +
scale_x_continuous(limits = dists_xlim, expand = c(0,0), labels = NULL) +
scale_y_discrete(limits = rev, labels = NULL) +
labs(
title = "slabinterval",
x = NULL,
y = NULL
) +
theme(plot.margin = margin(5.5, 5.5, 5.5, 0))
theme(plot.margin = margin(5.5, 5.5, 5.5, 0), axis.ticks = element_blank())
```

```{r preview_dotsinterval, include=FALSE}
Expand All @@ -118,13 +118,14 @@ dotsinterval_plot = ggplot() +
scale_fill_brewer(palette = "Set2", guide = "none") +
scale_x_continuous(limits = dists_xlim, expand = c(0,0), breaks = NULL) +
scale_y_discrete(limits = rev, breaks = NULL) +
scale_x_continuous(limits = dists_xlim, expand = c(0,0), labels = NULL) +
scale_y_discrete(limits = rev, labels = NULL) +
labs(
title = "dotsinterval",
x = NULL,
y = NULL
)
) +
theme(axis.ticks = element_blank())
```

```{r preview_lineribbon, include=FALSE}
Expand Down Expand Up @@ -161,16 +162,16 @@ mtcars_plot = function(.width = c(.6, .8, .95), alpha = 1/4, ...) {
lineribbon_plot_1 = mtcars_plot() +
guides(color = "none", fill = "none", x = "none") +
scale_x_continuous(breaks = NULL) +
scale_y_continuous(breaks = NULL) +
scale_x_continuous(labels = NULL) +
scale_y_continuous(labels = NULL) +
labs(title = "lineribbon", x = NULL, y = NULL) +
theme(plot.margin = margin(5.5, 5.5, 0, 5.5))
theme(plot.margin = margin(5.5, 5.5, 0, 5.5), axis.ticks = element_blank())
lineribbon_plot_2 = mtcars_plot(.width = ppoints(30), alpha = 1/20) +
guides(color = "none", fill = "none") +
scale_x_continuous(breaks = NULL) +
scale_y_continuous(breaks = NULL) +
scale_x_continuous(labels = NULL) +
scale_y_continuous(labels = NULL) +
labs(x = NULL, y = NULL) +
theme(plot.margin = margin(0, 5.5, 5.5, 5.5))
theme(plot.margin = margin(0, 5.5, 5.5, 5.5), axis.ticks = element_blank())
```


Expand Down
Binary file modified man/figures/README/lineribbon-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README/preview-1.png
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 892ebe5

Please sign in to comment.