2017-05-18 25 views
0

横棒グラフplotlyのY軸の幅を広げたいとします。今、y軸が狭すぎるため、テキストはプロットの中に入ります。Plotly:幅を広げる方法Y軸?

Plotlyのexamplesページでも同じようなことが起こります。ここでは、カテゴリは単純には読みにくいです。

幅を広げる方法が見つかりません。ヘルプは高く評価されています!

例コード:

library(plotly) 
p <- plot_ly(x = c(20, 14, 23), 
    y = c('long string which is not readable', 
    'orangutans (not readable)', 
    'monkeys'), 
    type = 'bar', 
    orientation = 'h') 
+0

UI上にあるように、https://help.plot.ly/axes/#step-8-axis-widthにする必要があります。 – Dendrobates

答えて

1

Plotlyは、あなたがドメインの下、x軸のレイアウトでこれを変更することができます...非常によくこれを隠しました。

次のように動作します:

ax <- list(
     domain = list(0.2, 1) 
    ) 
p <- plot_ly(x = c(20, 14, 23), 
    y = c('long string which is not readable', 
    'orangutans (not readable)', 
    'monkeys'), 
    type = 'bar', 
    orientation = 'h') %>% 
layout(xaxis = ax) 

一般的なヒント:Plotlyは、すべての設定が含まれているJSONオブジェクトを、エクスポートすることができonline editorを持っています。そのオブジェクトを検索すると、適切な設定を見つけるのに役立ちます。

関連する問題