position_dodge not working with categorical y and continous x variables
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
首先使用 dots 数据集运行 issue 中的两个 plotnine 示例,比较针对分类 x 和分类 y 的 position_dodge。跟踪 position_dodge 和 geom_point 的入口点,找出连续 x 与分类 y 未被分离的原因,然后添加或更新一个回归测试,以展示预期的 dodge 输出。
由索引模型根据 Issue 内容生成。
描述
I illustrate the problem with the dots dataset:
import pandas as pd
from plotnine import *
dots = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/dots.csv')
Now, I plot with categorical x and continuous y variable:
(
ggplot(dots, aes(y='coherence', x='align', color='choice'))
+ geom_point(position = position_dodge(width=0.8))
)
This worked fine. Now, I swap the x- and y-axis:
(
ggplot(dots, aes(x='coherence', y='align', color='choice'))
+ geom_point(position = position_dodge(width=0.8))
)
Now, position_dodge did not work anymore.
ggplot2 gives me what I would expect (I execute the following in a Jupyter notebook)
%load_ext rpy2.ipython
%%R -i dots
library(ggplot2)
(
ggplot(dots, aes(x=coherence, y=align, color=choice))
+ geom_point(position = position_dodge(width=0.8))
)
Software versions:
import session_info
session_info.show()
-----
pandas 2.2.2
plotnine 0.13.6
session_info 1.0.0
-----
Click to view modules imported as dependencies
-----
IPython 8.26.0
jupyter_client 8.6.2
jupyter_core 5.7.2
-----
Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0]
Linux-3.10.0-1062.18.1.el7.x86_64-x86_64-with-glibc2.17
-----
Session information updated at 2024-07-15 16:29
- 主要语言
- Python
- 星标
- 4.8k
- 派生
- 260
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
has2k1/plotnine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
Enhancement
难度 3/5 半天 新手友好度 55/100
has2k1/plotnine#1141 · 2 条评论 ·
维护者通常 1 天内回复
-
Enhancement
难度 4/5 3-5 天 新手友好度 52/100
has2k1/plotnine#1081 · 3 条评论 ·
维护者通常 1 天内回复
-
Discussion
难度 5/5 一周以上 新手友好度 30/100
has2k1/plotnine#1047 · 15 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
Documentation Plot Composition Question
难度 3/5 1-2 天 新手友好度 45/100
has2k1/plotnine#1036 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
bug triage
难度 2/5 1-3 小时 新手友好度 78/100
mealie-recipes/mealie#9117 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
freelawproject/courtlistener#8406 ·
维护者通常 2 天内回复
-
good first issue help wanted level 1 wocs
难度 2/5 1-3 小时 新手友好度 78/100
GianlucaBave/murmury#49 ·
维护者通常 1 天内回复
-
regression skipped skipped_bmg
难度 2/5 1-3 小时 新手友好度 76/100
intel/torch-xpu-ops#6142 · 1 条评论 ·
维护者通常 2 天内回复
-
good first issue help wanted python up-for-grabs
难度 1/5 1 小时以内 新手友好度 85/100
andrewsiah/agentswarm-data-tasks#122 ·
维护者通常 1 天内回复