matplotlib / matplotlib/ipympl

Figures in Output disappear if Output displayed twice in same cell

Đang mở
#237 2 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ả

Describe the issue

Got an odd one.
If an Output contains a figure, and one calls a single cell containing display(Output) twice, the output "empties" and no figure is shown.

Example below. One can emphasise it by first calling display(o) in one cell, and then doing the double call (I press ctrl + Enter twice) in another cell. I attach a figure showing the result.
image

# in one cell:
%matplotlib widget
import matplotlib.pyplot as plt
from ipywidgets import Output
o = Output()
with o:
    plt.figure()
    plt.plot([1,2,3])
# In a separate cell, call this twice after each other
display(o)

Versions

 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 17:32:17) [MSC v.1916 64 bit (AMD64)]
ipympl version: 0.5.6
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.7.2
ipython          : 7.13.0
ipykernel        : 5.2.0
jupyter client   : 6.1.3
jupyter lab      : 2.1.4
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3
Known nbextensions:
  config dir: C:\Users\thomasaar\.jupyter\nbconfig
    notebook section
      default_cells disabled
  config dir: C:\Users\thomasaar\.conda\envs\py5\etc\jupyter\nbconfig
    notebook section
      ipyvolume/extension enabled
      - Validating: ok
      jupyter-webrtc/extension enabled
      - Validating: ok
      jupyter-matplotlib/extension enabled
      - Validating: ok
      plotlywidget/extension enabled
      - Validating: ok
      jupyter-js-widgets/extension enabled
      - Validating: ok
    tree section
      ipyparallel/main enabled
      - Validating: ok
JupyterLab v2.1.4
Known labextensions:
   app dir: C:\Users\thomasaar\.conda\envs\py5\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v2.0.0 enabled  ok
        @jupyter-widgets/jupyterlab-sidecar v0.5.0 enabled  ok
        jupyter-matplotlib v0.7.2 enabled  ok```

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 vấn đề bằng ví dụ notebook Python được cung cấp, gọi display(o) hai lần sau khi tạo một hình matplotlib bên trong một widget Output. So sánh lần hiển thị thứ nhất và thứ hai bằng các phiên bản JupyterLab, ipympl, matplotlib và ipywidgets được liệt kê; hoàn thành khi hình vẫn hiển thị sau lần hiển thị lặp 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ó
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
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.