This function will apply SP theme to any ggplot.
1 | sp_theme()
|
1 2 3 4 5 6 7 8 9 10 | ggplot2::ggplot(ggplot2::diamonds, ggplot2::aes(x=carat, y=price, color=cut)) +
ggplot2::geom_point() +
sp_theme() +
ggplot2::labs(title="This is my title",
subtitle = "This is my subtitle",
caption = "Source: this is my data source",
x="Carat",
y="Price")
# + theme(<ADDITIONAL ARGUMENTS TO OVERIDE DEFAULT SET BY SP_THEME>)
# NOTE : If sp_theme is applied at end it will override earlier arguments passed in theme ().
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.