Code Monkey home page Code Monkey logo

Comments (6)

cosimameyer avatar cosimameyer commented on June 27, 2024

Hi @brichard1638,
Thanks for reaching out and opening the issue. We'll look into it - just to be sure: Are you using version 0.0.11? (As a development version from GitHub or as the CRAN version?)

from overviewr.

brichard1638 avatar brichard1638 commented on June 27, 2024

from overviewr.

cosimameyer avatar cosimameyer commented on June 27, 2024

Hi @brichard1638,

Thanks! I had a look into your issue and here's an answer to your question:

  • overview_plot has a default color argument that requires a categorical variable. Here are some examples if you want to know more. If you add a string (blue) it behaves in a similar way as ggplot2
  • If you want to change the color your plot, just follow the ggplot2 logic and add layers :)

We first need some preparation:

toydata$dummy <- ifelse(toydata$year<1995, 0, 1)

which yields:
Screenshot 2022-08-08 at 20 49 51

We can now use dummy to plot it with overview_plot

overview_plot(dat = toydata, id = ccode, time = year, xaxis = "Time Frame", color = dummy)

Screenshot 2022-08-08 at 20 50 05

And with an additional layer:

 overview_plot(dat = toydata, id = ccode, time = year, xaxis = "Time Frame", color = dummy) + scale_color_brewer(palette="Dark2")

Screenshot 2022-08-08 at 20 59 48

I'll add it to our workflow descriptions on our website to make this clear (#13) - thanks for the suggestion! :)

When testing, adding the title with both ggtitle and/or labs works.

Let me know if this helps.

from overviewr.

brichard1638 avatar brichard1638 commented on June 27, 2024

from overviewr.

cosimameyer avatar cosimameyer commented on June 27, 2024

Hi Brice,

Thanks for your reply. I understand your concerns about the possible overhead that may be caused in the current form of overview_plot when changing the color but it basically follows the layering logic of ggplot2 and is - as we believe - in itself quite flexible (and versatile because people tend to know ggplot2). The idea how we originally designed overview_plot was to differentiate differing time periods from each other easily (and these time periods were typically part of the dataset (created throughout the data wrangling process); so we always needed them anyways for the analysis at a later stage and they were no extra dimension that was added to the dataset).
I think the point you're coming from is an interesting new take on how to envision the overview_plot function - so your idea would be to basically allow an additional color argument that let's the user define the color of the plot? (also without providing any additional information in the form of differing time periods?) I'm curious to hear your thoughts on this! ☺️

Cosima

from overviewr.

brichard1638 avatar brichard1638 commented on June 27, 2024

from overviewr.

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.