plotly / plotly/plotly.py

Box Plot line color changes the fill color as well, unless fill color is specified

Đang mở
#3,770 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P3
Ngôn ngữ chính
Python
Star
18.8k
Fork
2.8k
Merge trung bình
16 giờ 26 phút
Pull request đã merge (30 ngày)
21

Mô tả

When setting the line color for a box plot, it also makes the fill color of the box plot the same as the line color (with a different opacity I think). This is the case unless the fill color is set explicitly, but this doesn't help if for example your using a layout template for your colors. In my example below for the expected output I have to use a color picker to get the color of the default theme then put that into the fillcolor argument.

import plotly.graph_objects as go
import plotly.data
from plotly.subplots import make_subplots

data = plotly.data.iris()


fig = make_subplots(rows = 3, cols = 1, shared_xaxes=True)

fig.add_traces([
    go.Box(
            x = data["species"],
            y = data["sepal_length"],
            name = "no line color"
    ),
    go.Box(
            x = data["species"],
            y = data["sepal_length"],
            line = {"color":"black"},
            name = "line color = black"
    ),
    go.Box(
            x = data["species"],
            y = data["sepal_length"],
            fillcolor = "#a4adf8", #shouldnt need to do this
            line = {"color":"black"},
            name = "expected"
    )
], rows = [1,2,3], cols = [1,1,1])

fig

plot

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện Python được cung cấp với plotly.graph_objects.Box và so sánh ba trace, tập trung vào sự tương tác giữa line.color và fillcolor. Bản sửa hoàn tất khi việc đặt màu đường của một box plot không còn thay đổi màu tô mặc định, để ví dụ mong đợi hoạt động mà không cần chỉ định fillcolor.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.