Although plotly does display Arabic text correctly, when I try to use str_wrap or other means to wrap titles, it doesnt display the text properly. It appears to wrap the text incorrectly, breaking the sentence up at the wrong points.
I produce thousands of graphs in loops and they often have long titles, so I need a solution that would work iterably for different lengthed titles.
Heres a minimal working example:
string = “هل يمكن أن تخبرني بعمرك التقريبي”
title = str_wrap(string, width = 20)
plot_ly(data = data.frame(x=sample(1:4,100, replace = TRUE), y=sample(1:100,100, replace= TRUE)), x=~x, y=~y)%>%
add_histogram()%>%
layout(title = title)