Values clipped by `vmin` and masked values look alike, and the colourbar doesn't show clipping

未关闭 适合新手
#628 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
matplotlib, python

调研方向

从设置 vmin 和 vmax 并配置颜色条的绘图代码开始;issue 没有指定文件或测试。使用 pp.plot(da, vmin=0.0) 重现示例,并检查每个限值的裁剪如何表示。完成的标准是:被裁剪的值反映在颜色条的 extend 设置中,同时掩码值仍可区分。

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

描述

With vmin above some of the data, bins below it are drawn dark grey
((0.12, 0.16, 0.18)) and masked bins mid-grey ((0.5, 0.5, 0.5)). In a
figure these two greys are easy to confuse, and the colourbar has
extend='neither', so nothing shows that values were clipped.

import plopp as pp, scipp as sc

da = sc.DataArray(sc.array(dims=['y', 'x'], values=[[1.0, 2.0, 3.0], [-1.0, 2.0, 3.0]]),
                  coords={'x': sc.arange('x', 3.0), 'y': sc.arange('y', 2.0)})
da.masks['m'] = sc.array(dims=['y', 'x'], values=[[True, False, False], [False] * 3])
pp.plot(da, vmin=0.0)

Suggestion: set the colourbar's extend to 'min', 'max' or 'both'
when vmin/vmax clip the data.

Reproduced on plopp 26.11.0, scipp 26.9.0, matplotlib 3.11.2.

主要语言
Python
星标
12
派生
7
平均合并
16 小时 5 分钟
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

scipp/plopp 的其他 Issue

查看 scipp/plopp 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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