# Example 1 - BaseR
# As a starting point, there is a plot i base R graphic:
sample_df <- data.frame(x=1:8, y=1:8, category=as.character(1:8), col_cont = 1:8)
barplot(sample_df$y, col=sample_df$category)
# Now, by applying hte set_theme() we can change the default behavior:
profiplots::set_theme("blue-red", "blue-red")
barplot(sample_df$y, col=sample_df$category)
# To turn the theming off, just call:
profiplots::unset_theme()
# Example 2 - GGplot
library("ggplot2")
plot_gg <- ggplot(sample_df, aes(x=x, y=y, fill=category)) + stat_identity(geom="bar")
plot_gg
# Now, let's trun it into Profinit graphics.
profiplots::set_theme("blue-red", "blue-red")
plot_gg
# To remove the Profinit theme from defaults, just call:
profiplots::unset_theme()
Run the code above in your browser using DataLab