2017-01-03 5 views
-1
library(plotly) 

とヒストグラム:はplotlyこのデータのログ・ビン

exDT2 <- structure(list(outflow = c(-150, -195, -200, -200, -200, -200, 
-250, -250, -250, -250, -255, -300, -300, -300, -300, -300, -305, 
-305, -350, -350, -400, -400, -435, -450, -450, -450, -450, -450, 
-455, -455, -464, -470, -470, -500, -500, -500, -500, -500, -500, 
-5000)), .Names = "outflow", row.names = c(NA, -40L), class = c("data.table", 
"data.frame")) 

私は good label

plot_ly(exDT2, x = ~-outflow, type = "histogram") %>% layout(xaxis = list(title = "Title", type = "log")) 

が、のように見えるのビンと同じように見ているx軸ラベルでplotlyグラフにしたいです good bins

plot_ly(exDT2, x = ~log(-outflow), type = "histogram") %>% layout(xaxis = list(title = "Title")) 

つまり、ビンを指数関数的に増加させるが、対数軸(ビンは同じ幅で表示されるようにする)と便利な軸ラベルを使用して、log-dollarsを表示するのではなく、

これは plotlyで行うことができる場合
+1

が追加されました。 – hedgedandlevered

+0

downvoteについてのフィードバックはありますか? – hedgedandlevered

答えて

0

は私は知りませんが、あなたはggplot2ggplotlyに開かれている場合は、多分あなたは試みることができる:

ggplot(exDT2, aes(-outflow)) + 
geom_histogram(binwidth = 0.2, fill="blue") + 
scale_x_log10(breaks=c(100, 200,500,1000, 5000)) + theme_bw() 
ggplotly() 

は何をしたいということですか?