-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart axis type defaults #578
Comments
I am not sure if this is by design? In which case please close the issue... |
Currently you need to manually specify that you have a categorical axis. plot_ly(df, x = x, y = y, mode = "markers") %>% layout(xaxis = list(type = "category")) Right now we just sent the factor levels as a string to plotly.js plotly_build(plot_ly(df, x = x, y = y, mode = "markers"))$data[[1]]$x
#> [1] 1000 2000 4000 8000 16000 32000
#> Levels: 1000 2000 4000 8000 16000 32000 Based on those strings, plotly.js (correctly) thinks that you want a numeric axis. In the future, we should set smarter axis type defaults based on the variable mappings. |
Ah okay got it. I haven't used |
Order of categorical axis should reflect factor levels. Fixes #578.
Hello, I am still having problem and even
Plotting:
Result: Categorical variables at y-axe aren't in the same order as
|
@cpsievert @timelyportfolio I was trying to answer this question on SO and came across this:
The text was updated successfully, but these errors were encountered: