-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
qt5agg image quality changes when window is out of focus #13012
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
Comments
Does this happen with any other backend? I wonder if this might be
something Ubuntu's window manager might be doing. You wouldn't happen to be
using something custom like Mint or Cinnamon? Which desktop manager are you
using?
…On Mon, Dec 17, 2018 at 5:02 PM Deepak Cherian ***@***.***> wrote:
Bug report
*Bug summary*
Quality of qt rendered figures is drastically reduced when window is moved
out of focus and then back in focus.
*Code for reproduction*
import matplotlib.pypot as plt
plt.plot([1, 2, 3, 4], [5, 5.5, 6.5, 8.5], alpha=0.5)
*Actual outcome*
[image: mpl-before]
<https://user-images.githubusercontent.com/2448579/50118171-c4b71100-0203-11e9-9bbf-1cc763aa1525.png>
Switch to different window and back:
[image: mpl-after]
<https://user-images.githubusercontent.com/2448579/50118177-c7b20180-0203-11e9-9e72-f26dbbfed192.png>
At this stage, calling plt.draw() fixes it till the window goes out of
focus. Zooming in on the figure also returns it to the earlier quality.
Note that transparency is lost.
*Expected outcome*
Rendering doesn't change.
*Matplotlib version*
- Operating system: Ubuntu 16.04
- Matplotlib version: 3.0.2
- Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
- Python version: 3.6.7
- Jupyter version (if applicable): console 6.0.0
- Other libraries: pyqt 5.6.0 py36h8210e8a_7 conda-forge
everything installed from conda-forge using conda.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13012>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AARy-AIeOjNuRgj2ww9jke3Nh45WBVwsks5u6BRtgaJpZM4ZXNbe>
.
|
I'm using Xfce and the Tk backend works fine. |
Do you have other transparency than the alpha on the line? |
No, but |
Yes, that is likely the critical detail! If you repeatedly focus / defocus does it get worse? I think what is going on is that for GUI backends we use Agg to render and RGBA buffer and then use the GUI frameworks matplotlib/lib/matplotlib/backends/backend_qt5agg.py Lines 41 to 43 in 529410f
If you delete the 3 lines above does the problem go away? |
Yes! When I remove those three lines my figure background is black. |
How about leaving just |
Yup, commenting out this line fixes things:
|
Re-focusing the figure window will call the draw method. If the facecolor of the figure and axes are transparent and we do not erase the widget we are effectively compositing the figure on to its self which results in artifacts anywhere there is alpha or anti-aliasing. Closes matplotlib#13012
Re-focusing the figure window will call the draw method. If the facecolor of the figure and axes are transparent and we do not erase the widget we are effectively compositing the figure on to its self which results in artifacts anywhere there is alpha or anti-aliasing. Closes matplotlib#13012
Re-focusing the figure window will call the draw method. If the facecolor of the figure and axes are transparent and we do not erase the widget we are effectively compositing the figure on to its self which results in artifacts anywhere there is alpha or anti-aliasing. Closes #13012
Bug report
Bug summary
Quality of qt rendered figures is drastically reduced when window is moved out of focus and then back in focus.
Code for reproduction
Actual outcome
Switch to different window and back:

At this stage, calling
plt.draw()
fixes it till the window goes out of focus. Zooming in on the figure also returns it to the earlier quality. Note that transparency is lost.Expected outcome
Rendering doesn't change.
Matplotlib version
print(matplotlib.get_backend())
): Qt5Aggeverything installed from conda-forge using conda.
The text was updated successfully, but these errors were encountered: