-
Notifications
You must be signed in to change notification settings - Fork 11
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
overview_plot Function Does not Plot Correctly #11
Comments
Hi @brichard1638, |
Cosima:::
Good morning! Yes, I am using the latest CRAN version of the overviewR package 0.0.1.1.
Warm regards,
Brice
…________________________________
From: Cosima Meyer ***@***.***>
Sent: Monday, August 8, 2022 4:40 AM
To: cosimameyer/overviewR ***@***.***>
Cc: brichard1638 ***@***.***>; Mention ***@***.***>
Subject: Re: [cosimameyer/overviewR] overview_plot Function Does not Plot Correctly (Issue #11)
Hi @brichard1638<https://github.com/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?)
—
Reply to this email directly, view it on GitHub<#11 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASLI5UIX7WDTZQE5MTUZCH3VYDBWHANCNFSM552TMCUQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @brichard1638, Thanks! I had a look into your issue and here's an answer to your question:
We first need some preparation:
We can now use
And with an additional layer:
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 Let me know if this helps. |
Cosima:::
That seems like extra overhead just to change the color theme of a plot. I would encourage you to rethink the ideas currently defining how the overview_plot is crafted.
There should be an argument to change the color scheme without having to add extra dimensional variables to your dataset. In addition, colors should be allowed to be expressed beyond the scope of numeric values but should also include actual color names (blue, green, etc.).
Thank you for considering my remarks.
Warm regards,
Brice Richard
Data Scientist
Washington, DC USA
…________________________________
From: Cosima Meyer ***@***.***>
Sent: Monday, August 8, 2022 3:07 PM
To: cosimameyer/overviewR ***@***.***>
Cc: brichard1638 ***@***.***>; Mention ***@***.***>
Subject: Re: [cosimameyer/overviewR] overview_plot Function Does not Plot Correctly (Issue #11)
Hi @brichard1638<https://github.com/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<https://cosimameyer.github.io/overviewR/articles/overviewR_vignette.html#overview_plot>. 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]<https://user-images.githubusercontent.com/7782895/183494080-d297f472-7288-4cf5-be9d-823048583039.png>
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]<https://user-images.githubusercontent.com/7782895/183494238-2b6fea7a-3145-475a-bbb8-98c38ed93a82.png>
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]<https://user-images.githubusercontent.com/7782895/183494271-5596ebfe-f881-4b6a-9648-366cff11fa47.png>
I'll add it to our workflow descriptions on our website to make this clear (#13<#13>) - thanks for the suggestion! :)
When testing, adding the title with both ggtitle and/or labs works.
Let me know if this helps.
—
Reply to this email directly, view it on GitHub<#11 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASLI5UI44WIIDEVBKNXIWLTVYFLFTANCNFSM552TMCUQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi Brice, Thanks for your reply. I understand your concerns about the possible overhead that may be caused in the current form of Cosima |
Cosima:::
Thank you for your response and your continued interest in some of my ideas.
I have worked with other R package developers in the with ideas that were subsequently integrated into their packages.
The reason I am informed on many of these ideas is because I developed a tool that can monitor the global technologies introduced into R as packages supporting either ML, software engineering, or data science proper. So, I am consistently evaluating new and emerging technologies as well as the ways in which package developers are applying the R language to execute the functionality used in these packages.
I will tell you there appears to be a movement away from ggplot2 in terms of independent user deployment of plotting. There is becoming more of a reliance on package developers to integrate supporting plots into their packages without having to separately create them. Of course ggplot2 will always exist in some form but it will be used less by users and more by package developers.
Having said that, R plots used to support their corresponding packages should be endowed with a rich set of arguments to maximize the flexible use and presentation of these plots. This includes color, titles, and where appropriate, size and shape of plot parts.
Examples that exemplify these features include but are not limited to WVPlots (HexBinPlot, DoubleHistogramPlot, ScatterHist, and ShadowHist), ezplot (histogram_plot), and ggpubr (ggballoonplot, gghistogram). The tendency with the application of color in these plot forms is to either provide a color or a palette argument to effect the plot output.
I also have some ideas to consider for future functions related to how dates can be disaggregated especially when working on customer churn-based projects. I believe your overviewR package is the ideal package to incorporate additional date-parsing capabilities which do not exist in other packages in the R environment.
I apologize for the long-winded response but there is much to say on this issue.
Warm regards,
Brice Richard
Data Scientist
Washington, DC USA
…________________________________
From: Cosima Meyer ***@***.***>
Sent: Tuesday, August 9, 2022 3:31 PM
To: cosimameyer/overviewR ***@***.***>
Cc: brichard1638 ***@***.***>; Mention ***@***.***>
Subject: Re: [cosimameyer/overviewR] overview_plot Function Does not Plot Correctly (Issue #11)
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!
|
It appears that the overview_plot function is not plotting correctly. In version 0.0.1.1, the following code does not plot correctly:
overview_plot(dat = toydata, id = ccode, time = year, xaxis = "Time Frame", color = "blue") + labs(title = "Hello World")
The output returns an x-axis label that reads "blue" and the line graphics in the plot are not colored correctly. I did load ggplot2 along with a labs geom to return a title. It is not known if adding this geom has contributed or is the principal cause of the issue.
The text was updated successfully, but these errors were encountered: