matplotlib / matplotlib/ipympl
(Auto-)Resize plots that start too large
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 1.7k
- Fork
- 234
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
## Describe the issue
Plots by default are sometimes too large, and the right side is cut off (e.g. when using the sexy Jupyter Lab side-by-side rendering or just using a small screen. Obviously you then want to resize them. However, since the resize handle is at the bottom right, it is also not visible. So the only current solution is to manually change the figure size in the code and re-run until it is visible. Not an ideal solution; sometimes you may not have direct access to the code creating the figure.
Some possible solutions:
- add a horizontal scrollbar (probably would need to be done on the JupyterLab side)
- introduce an auto-resize feature in the ipympl figure toolbar that will automatically resize the figure to the available width when pressed
- auto resize all newly created figures, maybe activatable by an "%ipympl autoresize" magic method
- make the handle location configurable
- scale the entire figure such that all of it is always visible (probably doesn't work too well with manual resizing), just like for inline plots
The current state is rather frustrating.
Example:

## Versions
jupyterlab==3.2.8
jupyterlab-widgets==1.0.2
ipympl==0.8.7
ipywidgets==7.6.5
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 việc xem xét thanh công cụ figure của ipympl và cách JupyterLab hiển thị các figure cạnh nhau. So sánh các cách tiếp cận được đề xuất để làm cho một plot quá lớn có thể sử dụng được, sau đó xác định hành vi resize dự kiến và kiểm tra hành vi đó trong các phiên bản JupyterLab, ipywidgets và ipympl được liệt kê; issue không nêu tên file hoặc test nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- jupyter, jupyter-notebook
- Lĩnh vực
- data-visualization, frontend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100