[BUG]: `histogram2dcontour` uses wrong fill colors for negative values
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện CodePen được cung cấp cho một trace histogram2dcontour sử dụng các giá trị z âm và có histfunc được đặt thành avg, min hoặc max. Theo dõi đường dẫn kết xuất histogram2dcontour và xác minh rằng phần tô đường đồng mức của các bin âm khớp với nhãn tương ứng và colorscale trên cả ba hàm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
First reported in plotly.py: https://github.com/plotly/plotly.py/issues/3799
histogram2dcontour traces use incorrect fill colors when bin values are negative.
Negative bin values can occur when histfunc is set to 'avg', 'min', or 'max', and the input z array contains negative values.
When some bin values are negative, all negative bin values are filled with the same color as 0 on the colorscale, while the outermost fill level is filled with the same color as the lowest number on the colorscale.
Example
Codepen reproduction: https://codepen.io/emilykl-code/pen/PwpPjMb
Code:
Show code
const x = [1, 2, 3, 4, 1, 2, 3, 4];
const y = [1, 1, 1, 1, 2, 2, 2, 2];
// The bug is triggered when histfunc is 'avg', 'min', or 'max',
// and some z-values are negative such that some resulting bin values
// end up negative
// This example uses all-negative z values to show the most extreme
// case, but not all z-values need to be negative to trigger the bug
const z = [-10, -50, -100, -150, -10, -50, -100, -150];
Plotly.newPlot('div1', [{
type: 'histogram2dcontour',
x: x,
y: y,
z: z,
histfunc: 'avg', // or 'min' or 'max'
contours: {
coloring: 'fill',
showlabels: true,
},
}],
{
title: {
text: 'histogram2d contour plot: wrong fill colors!',
subtitle: {
text: 'Compare contour labels on plot to colorscale'
}
}
});
Screenshot:
Expected behavior
Contour fills should match fill colors indicated by colorscale
- Ngôn ngữ chính
- JavaScript
- Star
- 18.3k
- Fork
- 2k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 30
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/plotly.js
-
chore P3 plotly-internal size: 3 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
chore P1 plotly-internal size: 1 task
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
chore P3 plotly-internal size: 1 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug infrastructure P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Tất cả issue của plotly/plotly.js
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nightscout/nocturne#1414 ·
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·