Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Visual Studio Code Python extension with Jupyter interactive window on a Retina display

Is there a way to instruct the Jupiter interactive window to use a Retina display with the Python extension of Visual Studio Code? For example, this minimal code

#%%
import numpy as np
from matplotlib import pyplot as plt
x = np.linspace(-10, 10, 1000)
plt.plot(x, np.sin(x))

produces an output that shows clearly the image pixels (note the resolution difference between the text "matplotlib.lines.Line2D..." and the plot markers):

output of the code

Using the standard line

%config InlineBackend.figure_format = 'retina'

unfortunately does not seem to solve the problem: it makes images twice as large, but still not retina-display ready.

like image 379
Marco Lombardi Avatar asked Oct 24 '25 20:10

Marco Lombardi


1 Answers

Try using the setting %config InlineBackend.figure_format='svg', it seems to have the best resolution without the scaling issue.

like image 154
Jonathan Avatar answered Oct 26 '25 10:10

Jonathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!