matplotlib / matplotlib/ipympl

rendering issues when exception is raised before cell execution completes

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

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ả

Reposting from [jupyter/notebook issue](https://github.com/jupyter/notebook/issues/2166#issuecomment-280676430). The code cell as appears in the screen shot is:
```
import ipympl
import matplotlib.pyplot as plt

def plot_something():
plt.figure()
plt.plot([0,2],[0,2],'-')
plt.show()

plot_something()
raise Exception
```

The behavior I am seeing is different for the first time I run the cell and the next times. It is also different for different level of browser zoom levels (I am using Chrome 56.0.2924.87 on Windows 8.1)-

First time that the cell is run -
The figure appears but is not fully rendered (see image)-
![notebook_matplotlib_exception_ipympl](https://cloud.githubusercontent.com/assets/721123/22962876/5eed393c-f358-11e6-8d84-047a50ace0d7.jpg)
If I then resize the figure using the GUI (bottom right corner), the behavior changes based on browser zoom level-
1. When using 100% zoom level (default), the figure is rendered too small. When in this state the zoom rectangle is drawn offset from the mouse pointer. The zooming is determined by the mouse pointer, it is just the drawing of the rectangle that is off.
2. When using 90% zoom level (ctrl^- once), the figure is rendered to size and the zoom rectangle is working fine.

When I rerun the cell the figure is re-rendered properly without need for resizing and independent of zoom level.

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

Tái hiện ô Python được cung cấp trong tích hợp notebook của ipympl bằng môi trường Chrome đã báo cáo, bao gồm lần chạy đầu tiên, ngoại lệ được phát sinh, việc thay đổi kích thước hình và các mức thu phóng của trình duyệt. So sánh kết xuất ban đầu với các lần chạy tiếp theo; được xem là hoàn tất khi hình được kết xuất ở đúng kích thước và hình chữ nhật thu phóng vẫn thẳng hàng sau ngoại lệ mà không cần thay đổi kích thước hoặc chạy lại.

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-notebook, matplotlib, python
Lĩnh vực
data-visualization, frontend
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.