首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Plotly绘图在flexdashboard中被推出边界

Plotly绘图在flexdashboard中被推出边界
EN

Stack Overflow用户
提问于 2020-09-17 04:28:28
回答 1查看 291关注 0票数 0

我很难让我的情节图适合它的flexdashboard容器。底部被切掉了。

考虑以下reprex:

代码语言:javascript
复制
---
title: "Plotly Flexdashboard Conflict"
output: 
  flexdashboard::flex_dashboard:
      source_code: embed

---

Column
---

### In this tab, the plot is pushed out of bonds by the selectize items.

```{r}

库(Tidyverse)

库(绘图)

库(Gapminder)

库(Flexdashboard)

gapminder_highlighted <-

highlight_key(gapminder1:408,,~country,“选择国家”)

gapminder_ggplot <-

gapminder_highlighted %>%

ggplot(aes(x =年,y= lifeExp,组=国家),alpha = 0.2) +

geom_line()

gapminder_plotly <- ggplotly(gapminder_ggplot)

高亮显示(gapminder_plotly,dynamic = T,selectize = T,persistent = T)

代码语言:javascript
复制
### Without selectize, all is well. The x axis is visible.

```{r}

gapminder_plotly

代码语言:javascript
复制
Column
---

### When plots overflow, flexdashboard is meant to add a scrollbar. E.g.

```{r}

plot(汽车)

绘图(Nhtemp)

plot(汽车)

绘图(Nhtemp)

代码语言:javascript
复制
### Although this does not actually work for all elements. E.g. Text generated from code chunks fails to trigger slider addition: 

```{r}

cat( rep("Flex不响应此处的文本溢出。",100)

print(“此行被隐藏”)

代码语言:javascript
复制

这里的输出在Rpubs上,所以你可以看看:https://rpubs.com/kenwosu/661556

第一个gapminder图被选择项推出边界。而且flexdashboard不会像它应该的那样触发添加垂直滚动条。

任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2020-09-17 23:04:49

这个看起来是不是好一点?我将y轴更改为从0开始,它看起来显示得更清晰了一点。我刚刚将+ expand_limits(y = 0)添加到了ggplot图的末尾。我尝试过使用ggplotly(),但似乎是ggplot图形有图形问题。

代码语言:javascript
复制
---
title: "Plotly Flexdashboard Conflict"
output: 
  flexdashboard::flex_dashboard:
      source_code: embed

---

Column
---

### In this tab, the plot is pushed out of bonds by the selectize items.

```{r}

库(Tidyverse)

库(绘图)

库(Gapminder)

库(Flexdashboard)

gapminder_highlighted <-

highlight_key(gapminder1:408,,~country,“选择国家”)

gapminder_ggplot <-

gapminder_highlighted %>%

ggplot(aes(x =年,y= lifeExp,组=国家),alpha = 0.2) +

geom_line() + expand_limits(y = 0)

gapminder_plotly <- ggplotly(gapminder_ggplot)

高亮显示(gapminder_plotly,dynamic = T,selectize = T,persistent = T)

代码语言:javascript
复制
### Without selectize, all is well. The x axis is visible.

```{r}

gapminder_plotly

代码语言:javascript
复制
Column
---

### When plots overflow, flexdashboard is meant to add a scrollbar. E.g.

```{r}

plot(汽车)

绘图(Nhtemp)

plot(汽车)

绘图(Nhtemp)

代码语言:javascript
复制
### Although this does not actually work for all elements. E.g. Text generated from code chunks fails to trigger slider addition: 

```{r}

cat( rep("Flex不响应此处的文本溢出。",100)

print(“此行被隐藏”)

代码语言:javascript
复制
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63927511

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档