Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive plots stay small when process busy on HiDPI displays #10456

Closed
ahoereth opened this issue Feb 14, 2018 · 2 comments
Closed

Interactive plots stay small when process busy on HiDPI displays #10456

ahoereth opened this issue Feb 14, 2018 · 2 comments
Labels
status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action third-party integration: jupyter

Comments

@ahoereth
Copy link

ahoereth commented Feb 14, 2018

Bug report

Bug summary

When using %matplotlib notebook in Jupyter Notebooks on a HiDPI screen (tested on multiple MacBooks of different generations), the plot stays half-sized until the cell is finished with all its computations.

Code for reproduction

%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
import time

def draw(ax):
    """Scatter some new data into an axis."""
    ax.cla()
    ax.scatter(*np.random.rand(2, 1000))
    ax.get_figure().canvas.draw()

_, ax = plt.subplots(1, 1)

for _ in range(10):
    # Draw some new data
    draw(ax)
    # Do some intermediate computations
    time.sleep(.1)

# Plot wont upscale till this sleep is over
time.sleep(10)

Actual outcome

Plots stay small until last sleep finishes.

Expected outcome

Plots should rescale to screen's DPI right after initial drawing.

Matplotlib version

  • Operating system: Ubuntu 16.04 / macOS 10.13
  • Matplotlib version: 2.1.2
  • Matplotlib backend: nbAgg
  • Python version: 3.6.4
  • Jupyter version: 4.4.0

Other Information

#5383 is probably relevant for when attempting to fix this problem.

@tacaswell tacaswell added this to the v2.2.1 milestone Feb 14, 2018
@tacaswell
Copy link
Member

There is something not quite right with the way we handle the negotiation about what the screen DPI is and do not fix it until the second draw. The way that draw gets triggered as the js side sends a message back asking for a re-draw, but we do not process that request until your code stops blocking.

The first issue can probably be fixed, but the second probably can not (see #4779 for longer discussion) be (at least in general and not without work on the jupyter side as well.

Would you be interested in working on fixing this?

Also have a look at https://github.com/matplotlib/jupyter-matplotlib which is built on top of ipywidgets and may behave better.

@jklymak jklymak modified the milestones: v2.2.1, v3.0 Mar 12, 2018
@tacaswell tacaswell modified the milestones: v3.0, v3.1 Aug 11, 2018
@jklymak jklymak modified the milestones: v3.1.0, v3.2.0 Mar 4, 2019
@tacaswell tacaswell modified the milestones: v3.2.0, needs sorting Sep 10, 2019
@github-actions
Copy link

github-actions bot commented May 1, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label May 1, 2023
@github-actions github-actions bot added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label May 31, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action third-party integration: jupyter
Projects
None yet
Development

No branches or pull requests

3 participants