DonJayamanne / vscodeJupyter

Jupyter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=donjayamanne.jupyter
MIT License
334 stars 34 forks source link

Retina matplotlib (IPython) #3

Open DonJayamanne opened 7 years ago

DonJayamanne commented 7 years ago

From @yay on March 3, 2017 23:30

Environment data

VS Code version: 1.10.1 Python Extension version:
Python Version: 3.6 OS and version: macOS 10.12.3

Note: this issue should be viewed on a retina display to see the difference.

Actual behavior

matplotlib images are blurry on hiDPI ("retina") displays:

screen shot 2017-03-04 at 00 07 33

The following startup options in package.json are used by the plugin by default:

screen shot 2017-03-04 at 00 07 42

Expected behavior

The following startup options are expected (if the devicePixelRatio is 2):

screen shot 2017-03-04 at 00 10 13

However, this still doesn't solve the problem competely, because the image is now twice the size, but still blurry:

screen shot 2017-03-04 at 00 08 19

This is because it has to be scaled down by 50% (which is the usual practice when rendering Canvas images on retina displays), to have the size of the original image above and look crisp:

screen shot 2017-03-04 at 00 08 190

Notice how the fonts are visibly sharper. For this particular plot the difference is not very dramatic, but it will vary depending on the content of the plot, and can be much more obvious.

Copied from original issue: DonJayamanne/pythonVSCode#786

DonJayamanne commented 7 years ago

From @yay on March 3, 2017 23:40

Would also be nice if kernel jsons were not created in the script folder or were automatically cleaned up.

screen shot 2017-03-04 at 00 36 26

As it is, they show up in the sidebar, and it's a drag to remove them manually, especially since you can't select multiple items in sidebar (e.g. with a ctrl-click) and have to remove them one by one.

DonJayamanne commented 7 years ago

From @yay on March 3, 2017 23:43

BTW, I only took the time to write all this because this extension is so awesome! :)

DonJayamanne commented 7 years ago

From @gandhis1 on March 4, 2017 0:23

I reported the second issue in #506

DonJayamanne commented 7 years ago

Thanks for the excellent and detailed info. Helps me look into this issue, considering I am a novice Jupyter user.

Not sure how this is related to 506 though

DonJayamanne commented 7 years ago

From @gandhis1 on March 4, 2017 1:50

His second post is