Violin plot in plotly

By Data Tricks, 5 September 2019

#Create some simulated data
data <- data.frame(Value = round(rnorm(n=100000, mean=100, sd=20),0),
                   Category = sample(c(1:2),100000,replace=TRUE))
data$Category <- as.character(data$Category)

#Basic violin plot
p <- plot_ly(data, y=~Value, type='violin', x0 = 'Label') %>%
  layout(yaxis = list(title = "Label")) %>%
  config(displayModeBar = F)

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Please note that your first comment on this site will be moderated, after which you will be able to comment freely.

Free data science in R guide

Sign up to our newsletter and we will send you a series of guides containing tips and tricks on data science and machine learning in R.

No thanks

You might also like