Giter VIP home page Giter VIP logo

jcolors's People

Contributors

jaredhuling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jcolors's Issues

Forthcoming release of ggplot2 and jcolors

We're in the process of preparing a ggplot2 release. As part of the release process, we run the R CMD check on packages that use ggplot2 to make sure we don't accidentally break code for downstream packages.

In running the R CMD check on jcolors, we identified the following issue:

  • checking examples ... ERROR
    Running examples in ‘jcolors-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: theme_dark_bg
    > ### Title: minimal theme for dark backgrounds
    > ### Aliases: theme_dark_bg theme_light_bg
    > 
    > ### ** Examples
    > 
    > library(ggplot2)
    > 
    > p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
    +          colour = factor(gear))) + facet_grid(vs~am)
    > p + theme_dark_bg()
    Error in axis.ticks.length.x.bottom %||% axis.ticks.length.x : 
      object 'axis.ticks.length.x.bottom' not found
    Calls: <Anonymous> ... with -> with.default -> eval -> eval -> %||% -> %||%
    Execution halted
    

As part of the new release, we improved the theme() function to allow different lengths of ticks on the top and bottom of the plot. As a result, theme_dark_bg_base() in jcolors is no longer complete, as it does not inherit from a current ggplot2 theme (like theme_grey()). We recommend using code like the following to define new themes, so that we can continue to improve the ggplot2 theme system without breaking others' code:

theme_custom <- function(base_size = 11, base_family = "", 
                         base_line_size = base_size/22, base_rect_size = base_size/22) {
  # Starts with theme_grey and then modify some parts
  ggplot2::theme_grey(
    base_size = base_size,
    base_family = base_family,
    base_line_size = base_line_size,
    base_rect_size = base_rect_size
  ) %+replace%
    ggplot2::theme(
      # insert your custom theme elements here
    )
}

For this to work, you will have to import %+replace% into your package namespace, which you can do by adding the following line to any roxygen documentation block:

#' @importFrom ggplot2 %+replace%

Let us know if we can help! We are hoping to release the next version of ggplot2 in the next two weeks.

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.