plotly / plotly/plotly.py

Scattermode=group does not autoscale yaxis

Đang mở
#4,220 0 bình luận 0 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ả

I'm plotting some data with a very elaborate box plot series, and attempting to overlay connecting median lines between each box in each series. I can do this successfully, but due the density of information, I need to stagger each x value using boxmode=group and scattermode=group. There are no issues with boxmode, but scattermode causes the lower y min to be set to 0. When scattermode is disabled, everything scales nicely, and when no boxes are drawn, the same issues persists. Using subplots and ensuring shared axes doesn't work, nor does updating axes with autorange.

Code:
`

fig = go.Figure()

point_visibility = point_checked
point_legend = False
box_visibility = True
match box_checked:
    case False:
        box_visibility = False
        point_legend = True

for col in dcr.columns[1:]:
    if box_checked:
        fig.add_trace(go.Box(
            x=dcr['SOC'],
            y=dcr[col],
            name=col,
            legendgroup=col,
            visible=box_visibility,
        ))
    if point_checked:
        fig.add_trace(go.Scatter(
            x=medians['SOC'],
            y=medians[col],
            name=col,
            legendgroup=col,
            showlegend=point_legend,
            visible=point_visibility,
            mode='lines',
        ))

fig.update_layout(
    yaxis_title='DCIR (Ohms)',
    xaxis_title='SOC',
    boxmode='group',
    scattermode='group',  # figure out how to align this to the boxes
)
fig.update_yaxes(autorange=True)  # has no effect

`

Not scaling:
not scaling

Disabling scattermode=group (No longer align to boxes):
no scatter group

What it should look like:
should look like

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 tái hiện ví dụ Box-and-Scatter được cung cấp trong plotly.py, so sánh autorange của trục y khi có và không có scattermode='group'. Truy theo các entry point của việc nhóm scattermode và autorange để xác định nơi giới hạn dưới trở thành 0, sau đó thêm một regression test bao phủ các scatter trace được nhóm cùng với các box trace và xác minh rằng autorange khớp với dữ liệu được plot.

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ó
4/5
Thời gian dự kiến
3-5 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
35/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.