Legend display for bubble sizes in geom_point
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
未提及任何文件、测试或代码入口点。首先复现所提供的 plotnine geom_point 示例,将大小映射到 var1,然后研究其连续大小图例的配置方式;当图例能够显示嵌套圆形,同时保留映射的大小标签时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hello - thanks again for your great work to implement ggplot2 functionality in Python!
My question is about an enhancement to the legend created when drawing a geom_point() plot with a size mapped to a continuous variable. Here's a minimal demo example:
import polars as pl
import plotnine as p9
import numpy as np
rng = np.random.default_rng(12345)
n=150
df = pl.DataFrame({
"x": 10 * rng.random(size=n),
"y": 5 * rng.random(size=n),
"var1": 100 * rng.random(size=n),
})
(
p9.ggplot(df, p9.aes("x", "y", size="var1"))
+ p9.geom_point(color='black', fill='white')
)
which creates the following plot with point sizes mapped to var1.
All good so far, but I'd like to show the legend entries as nested circles, rather than the conventional stacked style as shown on the plot. The nested style is not only aesthetically pleasing but makes the relative sizes easier to compare. I have seen this style of legend used in The Economist and The Wall Street Journal as well as other publications. (see example below)
Not sure if ggplot2 offers this out of the box, but think this would be a nice feature!
Thanks
- 主要语言
- Python
- 星标
- 4.8k
- 派生
- 269
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
has2k1/plotnine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Feature request: add rotation_mode param to geom_text可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Feature
难度 2/5 1-3 小时 新手友好度 66/100
-
position_dodge2() leaves nested rectangles overlapping可能已有人在做 @MahnoorAhmed999 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
-
Enhancement
难度 3/5 半天 新手友好度 55/100
-
Enhancement
难度 4/5 3-5 天 新手友好度 52/100
相似的 Issue
-
Test: to_hijri() accepts datetime.datetime and uses only the date part可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 · 3 条评论 ·
维护者通常 1 天内回复
-
polish
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scores可能已有人在做 @AshutoshSingh840 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
UKGovernmentBEIS/control-arena#992 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
mvalentsev/awesome-free-ai-coding#70 ·
维护者通常 1 天内回复