shosaco / vistime

Pretty timelines in R.
https://shosaco.github.io/vistime
GNU General Public License v3.0
168 stars 11 forks source link

Modifying a `gg_vistime` using a `scale_color` function changes text color and adds legend #30

Closed jabenninghoff closed 1 year ago

jabenninghoff commented 2 years ago

Modifying a gg_vistime object with a ggplot2::scale_color function unexpectedly changes the text color and adds a legend.

Reproducible example below. This chart should look like the vistime example but does not.

library(ggplot2)
library(vistime)

timeline_data <- data.frame(event = c("Event 1", "Event 2"),
                            start = c("2020-06-06", "2020-10-01"), 
                            end   = c("2020-10-01", "2020-12-31"),
                            group = "My Events")

gg_vistime(timeline_data) + scale_color_discrete()
shosaco commented 1 year ago

I accept that as a current limitation of the package. Changing the theme afterwards has unwanted side effects :-/