DonJayamanne / vscodeJupyter

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

Jupyter Preview Bugs? #18

Open DonJayamanne opened 7 years ago

DonJayamanne commented 7 years ago

From @Scoodood on November 5, 2016 2:14

Hi @DonJayamanne, are these bugs related to the extension or VSCODE itself?

My System Setup

OSX 10.10.5, Code 1.7.1, Python Plugin 0.50

My Python Installation (Python 2.7.12 and Python 3.5.2)

>> brew install python python3
>> sudo pip2 install numpy matplotlib, jupyter, pandas, scipy
>> sudo pip3 install numpy matplotlib, jupyter, pandas, scipy

From terminal I can launch Python / iPython version 2 and 3 as follows:

>> python     # launches Python 2.7.12
>> ipython    # launches iPython 3.5.2
>> python2    # launchesPython 2.7.12
>> ipython2   # launches iPython 2.7.12
>> python3    # launches iPython 3.5.2
>> ipython3   # launches iPython 3.5.2

Feedback is recorded in these videos

  1. The "python.jupyter.defaultKernel": "Python3" does not work
  2. The Jupyter output doesn't work nicely with a Dark Color Theme
  3. Most Jupyter output disappear after switching to different tab and then come back again
  4. Another font resize bug!! Try to increase your font size with 2 panels open side by side with Jupyter
    out1
    out2

Test Code

#%%
import sys
print(sys.version)
counter = 0
print(counter)

#%%
counter += 1
print(counter)

#%%
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()

#%%
import matplotlib.pyplot as plt
import numpy as np
import mpld3
mpld3.enable_notebook()
fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE'))
ax.grid(color='white', linestyle='solid')
N = 50
scatter = ax.scatter(np.random.normal(size=N),
                     np.random.normal(size=N),
                     c=np.random.random(size=N),
                     s = 1000 * np.random.random(size=N),
                     alpha=0.3,
                     cmap=plt.cm.jet)
ax.set_title("D3 Scatter Plot", size=18);

Copied from original issue: DonJayamanne/pythonVSCode#488

DonJayamanne commented 7 years ago

Unfortunately the loss in information when switching tabs is an upstream issue (https://github.com/Microsoft/vscode/issues/5257). That said, I will consider implement a work around, that would re-paint the editor with the previous information once you tab back to the editor.