question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Low quality matplotlib inline plots on hidpi display

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

What steps reproduce the problem?

  1. set a custom high DPI scalling (default 1.5 or any larger value) in spyder Preferences -> General
  2. plot a line with matplotlib
import numpy as np
from matplotlib import pyplot as pp
pp.figure()
pp.plot(np.arange(100), 'k')
pp.grid()
  1. change inline backend figure format to retina
%config InlineBackend.figure_format = 'retina'
  1. repeat step 2.

What is the expected output? What do you see instead?

Expected the output to be smooth high quality DPI inline plot after change in inline figure format but instead blurry jagged low quality version is displayed as before

spyder-matplotlib-inline-plot

Jupyter notebook run shows correct smooth plot after inline figure format change

jupyter-ipython-inline-plot

Versions

  • Spyder version: 3.3.4
  • Python version: 3.6.7 64-bit
  • Qt version: 5.12.2
  • PyQt version: 5.12.1
  • Operating System name/version: Linux Mint 19.1 Cinnamon 4.0.10

Dependencies

IPython >=4.0     :  7.4.0 (OK)
cython >=0.21     :  0.29.6 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
matplotlib >=2.0.0:  3.0.3 (OK)
nbconvert >=4.0   :  5.4.1 (OK)
numpy >=1.7       :  1.16.2 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
psutil >=0.3      :  5.6.1 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pyflakes >=0.6.0  :  2.1.1 (OK)
pygments >=2.0    :  2.3.1 (OK)
pylint >=0.25     :  2.3.1 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
rope >=0.9.4      :  0.14.0 (OK)
sphinx >=0.6.6    :  2.0.1 (OK)
sympy >=0.7.3     :  1.4 (OK)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
ccordoba12commented, Apr 12, 2019

@dalthviz, please take a look at this one. We need to add a new option in the Inline backend section of our preferences called

[ ] Display images in high resolution

And pass that option to the kernel.

1reaction
ryblogscommented, Jul 29, 2021

No, this hasn’t been addressed yet, but we’ll try to do it in the next couple of months.

For now, you need to increase your DPI manually by going yo the menu

Tools > Preferences > IPython console > Graphics > Inline Backend

and the increasing the Resolution there.

Thank you for revisiting! Much appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Low quality window plots on hidpi display #17440 - GitHub
Executing python script with line plotting code from command line on a hidpi 4k resolution display produces low quality UI window plot.
Read more >
inline images have low quality - matplotlib - Stack Overflow
I'm loading a TIF file with scikit-image and displaying it inline in an ipython notebook (version 2.2 ...
Read more >
2 ways to improve the default resolution of matplotlib plots ...
Get improved resolution inline and on export · Solution 1. Change the default dpi settings in matplotlib · Solution 2. Change the default...
Read more >
Matplotlib Retina - Linux Hint
Matplotlib retina high-resolution basic function in creating a plot and examples of plotting graphs using ... Retina Displays with Inline Backend in Python....
Read more >
Incorrect pixel ratio used for Matplotlib plots in Jupyter ...
Steps to reproduce the problem: ... The two plots should look the same, have the same size, and use the full resolution of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found