Coder Social home page Coder Social logo

Comments (5)

alastairrushworth avatar alastairrushworth commented on August 24, 2024

Hi @bartekbursa. At the moment, there isn't an argument in show_plot() that does this, but I think it would be straightforward to add. It may also be possible to change this after the show_plot() call by manipulating the ggplot2 object. Is there a particular plot you have in mind?

from inspectdf.

bartekbursa avatar bartekbursa commented on August 24, 2024

Thanks for your response. It would be very convenient to be able to change some graphical parameters of the plots after show_plot(). In particular, I would like to change the color of the labels on plots made from inspect_cat from white to black. And possibly also the font size.

from inspectdf.

alastairrushworth avatar alastairrushworth commented on August 24, 2024

Thanks @bartekbursa. I agree, this would be a great feature to add. I've added it to the backlog and will leave this issue open until it's implemented.

In the meantime, an inelegant solution is to modify the ggplot2 object, for example:

library(dplyr)
library(inspectdf)
library(ggplot2)

# save the ggplot object
gf <- starwars %>% inspect_cat %>% show_plot
# decrease the label size
gf$layers[[2]]$aes_params$size <- 5
# change the text color - ignore the warning
gf <- gf + scale_colour_manual(values = c("red", "black"))
# view the modified plot
gf

Hope that helps!

from inspectdf.

bartekbursa avatar bartekbursa commented on August 24, 2024

Thanks @alastairrushworth for the workaround! It works fine :)

from inspectdf.

alastairrushworth avatar alastairrushworth commented on August 24, 2024

Hi @bartekbursa thanks for raising this issue. It is now possible to change the color of text label in several of the show_plot() outputs by adding the label_color = ... argument. I will add this change to the next cran release in a week or so. For example

library(dplyr)
library(inspectdf)
library(ggplot2)

starwars %>% inspect_cat %>% show_plot(label_color = c('red'))

For inspect_cat(), I haven't added flexibility to adjust the font size - resizing of text is handled internally at the moment. I might add the option to fix this size for a future release, but leaving as is for now, unless there is a good use case / example.

Thanks again for the suggestions :)

from inspectdf.

Related Issues (20)

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.