csdaw / ggprism

ggplot2 extension inspired by GraphPad Prism
https://csdaw.github.io/ggprism/
169 stars 21 forks source link

theme_prism() not working with ggplot2 #28

Closed Samuelmontalvo closed 3 months ago

Samuelmontalvo commented 6 months ago

Hello

I have been using your wonderful package, unfortunately, I started getting errors across all of my Rmarkdown and scripts. This started happening about a week ago.

For example:

p_HR_all <- final_result %>% ggplot(aes(x = Time, y = HR, color=Group)) + geom_smooth(method = "loess", se = TRUE) + labs(title = "", x = "Time (seconds)", y = "HR (bpm)") + theme_prism() + scale_x_continuous(limits = c(0, 180), breaks = seq(0, 180, 60)) p_HR_all

and the error would be:

Error in plot_theme(): ! The legend.text.align theme element is not defined in the element hierarchy. Backtrace:

  1. base (local) <fn>(x)
  2. ggplot2:::print.ggplot(x)
  3. ggplot2:::ggplot_gtable.ggplot_built(data)
  4. ggplot2:::plot_theme(plot) Error in plot_theme(plot) :

hopefully is a quick fix. Thank you

samuel-marsh commented 6 months ago

See #26

csdaw commented 3 months ago

This has been resolved in the latest ggprism CRAN version 1.0.5 :)