Skip to content

Instantly share code, notes, and snippets.

@awhstin
Last active April 1, 2016 23:16
Show Gist options
  • Save awhstin/c425e20c2870bb91217e3dc68f7d366a to your computer and use it in GitHub Desktop.
Save awhstin/c425e20c2870bb91217e3dc68f7d366a to your computer and use it in GitHub Desktop.
library(plotly)
p<-plot_ly(Words, x =outlet, y =Mean,text = rownames(Words), type="bar", showlegend = FALSE, marker=list(color="rgb(55, 83, 109)")) %>%
add_trace(Words,x=Words$outlet, y = Words$X4.13.am,mode="markers" ,name = "Hillary for President",
showlegend = TRUE, marker=list(color="rgb(234, 153, 153)"))%>%
add_trace(Words,x=Words$outlet, y = Words$X26.Apr, mode="markers", name = "Baltimore Riots/Nepal Earthquake",
showlegend = TRUE, marker=list(color="rgb(106, 168, 79)"))%>%
layout(legend = list(x = 0.5, y = 0.90), title = "Mean Sentiment of News Outlets in April 2015")
plotly_POST(p, filename = "News_Sentiment")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment