r动画情节:通过突出显示进行选择时,请勿调整气泡

发布于 2025-02-13 21:48:53 字数 724 浏览 1 评论 0 原文

创建动画气泡时,如果选择突出显示,则不会更改大小。 来自

library(plotly)
library(ggplot2)
library(gapminder) 

g <- highlight_key(gapminder, ~continent)

gg <- ggplot(g, aes(gdpPercap, lifeExp, 
      color = continent, frame = year)) +
      geom_point(aes(size = pop, ids = country)) +
      scale_x_log10()

p_gg <- highlight(ggplotly(gg), "plotly_click")

如果选择使用plotly框,则选定的气泡会改变大小,而动画 大小

预期 大小没有更改

不确定是否错误或我是否缺少设置

When creating an animated bubble plot bubbles are not changing size if selected using highlight.
Borrowing code from https://plotly-r.com/client-side-linking.html

library(plotly)
library(ggplot2)
library(gapminder) 

g <- highlight_key(gapminder, ~continent)

gg <- ggplot(g, aes(gdpPercap, lifeExp, 
      color = continent, frame = year)) +
      geom_point(aes(size = pop, ids = country)) +
      scale_x_log10()

p_gg <- highlight(ggplotly(gg), "plotly_click")

If select using plotly box the selected bubbles change size though the animation
expected size

If select using hihlight plotly_click the selected bubbles don't change size in the animation
size hasn't changed

Not sure if a bug or if I'm missing a setting

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文