Scattermode=group does not autoscale yaxis
Chưa có ai nhận issue này.
- 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:
Disabling scattermode=group (No longer align to boxes):
What it should look like:
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.
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