I have the following data:
Text refers to a narrative, mi is the count of a particular feature, and shi is the count of another feature. I have them in a data frame as follows. I'm not sure how manually recreate this dataframe with vectors of the values, so I apologize in advance that this isn't as reproducible as it otherwise could be.
test <- as.data.frame(read_excel("plotTEST.xlsx"))
I want a plot in which the x axis is each text, and y shows the counts of both features. I want to approximate something like this, as shown here or here.
Using those examples I cobbled together the following:
ggplot(data=test, aes(x=text, y=mi, fill=shi)) + geom_bar(stat="identity")
And through lots of tweaking and several iterations, this is the cleanest result I have gotten:
Gradient seems to be default despite the fact that I tried following the code in the linked examples and they don't give specific details about the color selections.
It's a gradient rather than discreet colors, how can I get discreet colors for the mi counts and shi counts?
I tried this solution mentioned here but that just results in another separate key with different colors and each bar gets a different colored outline.