plotly / plotly/plotly.py

[FEATURE]: Make it possible to base heights of horizontal bars (and widths of vertical bars) on a given variable

未关闭
#5,720 4 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@camdecoster 已经在做这个了。

开始于 2026年9月15日。

enhancement feature P3 size: 5
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

Description

I would love to make it possible to easily vary the width of vertical bars, or the height of horizontal bars, within a bar chart, to reflect a certain variable (such as the sample size on which that bar is based).

Why should this feature be added?

This would make it easier to visually represent an additional data point (e.g. sample size, monthly revenue, etc.), thus allowing viewers to get more context about a bar.

For example, suppose that you're showing the percentage of individuals in five political parties that support or oppose a certain measure. However, some of these parties have only a small amount of respondents. Varying the thickness of these bars by your sample size would make it clearer that some of your data points are based on a relatively small sample.

Mocks/Designs

Here is an example of what a variable-height horizontal bar chart would look like. (I created this using go.Bar() rather than px.bar(), but this involved a decent amount of additional code, including a custom legend. Being able to customize these heights via a 'bar_width' or 'bar_height' argument within px.bar would be terrific.

Image

贡献指南

打开贡献指南

从这里开始

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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