plotly / plotly/plotly.R

Zoom all facets at the same time

未关闭
#2,142 1 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

There seems to be a discrepancy between plotly for R and for python in how it handles zooming across facets.

To take my examples directly from the documentation: https://plotly.com/ggplot2/facet-plots/ vs https://plotly.com/python/facet-plots/

In the python version, if I select a region to zoom in on, the same zoom is applied to all facets, regardless of position.

In the r version, if I zoom on one facet, the 'x' zoom is applied to facets in the same column, and the 'y' zoom is applied to facets in the same row - but other facets are unaffected.

I would like to replicate the python behaviour in r. Any clues for how to do this?

Reprex: Compare zoom behaviour between R and python

library(reshape2)
library(plotly)

p <- ggplot(tips, aes(x=total_bill)) + geom_histogram(binwidth=2,colour="white")

# Histogram of total_bill, divided by sex and smoker
p <- p + facet_grid(sex ~ smoker)

ggplotly(p)
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df, x='gdpPercap', y='lifeExp', color='continent', size='pop',
                facet_col='year', facet_col_wrap=4)
fig.show()

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先运行 issue 中的 R reprex,并将其 facet 缩放行为与链接的 Python facet 示例进行比较。issue 没有指定任何 repository 文件或测试;完成意味着在一个 facet 中选择一个区域会将相同的 x 和 y 缩放应用于每个 facet。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, r
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。