Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving legend style #46

Open
dominicroye opened this issue Jul 1, 2024 · 0 comments
Open

Improving legend style #46

dominicroye opened this issue Jul 1, 2024 · 0 comments

Comments

@dominicroye
Copy link

I would like to propose a change in the style of the legend by changing to open axes with arrows. The following are changes I made on the basis of a biscale's older version.

leg <- tidyr::separate(x, bi_class, into = c("x", "y"), 
                        sep = "-")
 leg <- dplyr::mutate(leg, x = as.integer(x), y = as.integer(y))
 legend <- ggplot2::ggplot() + ggplot2::geom_tile(data = leg, 
                                                  mapping = ggplot2::aes(x = x, y = y, fill = bi_fill), 
                                                  lwd = pad_width, col = pad_color) + ggplot2::scale_fill_identity() + 
   ggplot2::labs(x = xQN, y = yQN) + bi_theme() + 
   ggplot2::theme_light() +
   ggplot2::theme(panel.border=element_blank(), 
                  axis.title.x = element_text(vjust = -.7, hjust = .2, size = size),
                  axis.title.y = element_text(vjust = .7, hjust = .2, size = size),
                  axis.line = element_line( size = .5, arrow = arrow(type = "closed", length = unit(.07, "in"))), 
                  axis.ticks = element_blank(),
                  axis.text = element_blank(),
                  panel.grid = element_blank(),
                  panel.background = element_blank(),
                  plot.background = element_blank()) + 
   lemon::coord_capped_cart(bottom="both", left = "both") 

Example:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant