[ Python Tools for Visual Studio Inline Graphics ]

This one should be simple, but I've been searching all over and it seems to be so simple that nobody else has encountered the problem yet :)

I just installed Python (2.7 Anaconda distribution) and Python Tools for Visual Studio with Visual Studio 2015 Community. It all appears to be working, but I would like to use the inline graphics feature and can't get it to work. This code should (I think) do it, but instead shows nothing in the interactive window and pulls up a new blank window for the plot.

import numpy as np
import matplotlib.pyplot as plt
plt.ion()
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C,S = np.cos(X), np.sin(X)

plt.plot(X,C)
plt.plot(X,S)

Do I need to configure something else before the inline graphics will work?

Answer 1


I had just about given up on this when I stumbled onto the solution on the GitHub page for PTVS: https://github.com/Microsoft/PTVS/wiki/Using-IPython-with-PTVS

After installing ipython and matplotlib (which I already had), you need to click "Configure interactive window" within the Visual Studio "Python Environments" window and then set the Interactive Mode to IPython instead of Standard.