X轴隐藏在Plotly-R中

时间:2016-04-05 16:33:57

标签: r plotly r-plotly

我正在使用情节。我制作的每个图形都有x轴半隐藏。即使我使用x轴的变量作为y轴,也会发生这种情况。例如,请考虑以下数据集:

 plot_ly(n, x = OppLoss, y = City, name = OppLoss, mode = "markers", marker = list("pink"))

我使用了以下代码:

f <- list(
  family = "Courier New, monospace",
  size = 10,
  color = "#7f7f7f"
)

plot_ly(n, x = OppLoss, y = City, name = OppLoss, mode = "markers", marker = list("pink")) %>% layout(xaxis = f, yaxis = f)

条形图,折线图等也是如此。我尝试使用以下代码更改设置:

responsive-md

没有什么能真正改变x轴或y轴。不确定我做错了什么。

1 个答案:

答案 0 :(得分:4)

只是玩边缘。考虑一下:

m = list(
  l = 200,
  r = 40,
  b = 100,
  t = 50,
  pad = 0
) 

plot_ly(n, x = OppLoss, y = City, name = OppLoss, mode = "markers", marker = list("pink")) %>% 
layout(autosize = F, margin = m)