I am trying to make a barplot in the Plotly package in R. By default Plotly stacks the values belonging to the same categories. I would like to plot the values sepeartely even if they belong to the same category. Following is an example:
value<-c(1,2,3,4,5)
Feature_Names <- c("A","B","C","D","C")
df1 <- data.frame(Feature_Names, value)
p7<-plot_ly(df1,x=~Feature_Names,y=~value,type='bar') %>%
layout(title= "Feature and values", xaxis= list(title='Feature_Names'))
show(p7)
The output of the above code is :
I would like a way to display the values of Feature Name "C" separately as two individual bars. How do I achieve that? Thanks.