2

I'm using LightTable with the Anaconda Python distribution (for Mac). I'm trying to get the Matplotlib inline plots to appear for a simple code like the following (but with the plt.show() command uncommented):

# -*- coding: ascii -*-
import numpy as np
import matplotlib.pyplot as plt

def myplot():
  x = np.linspace(0.0, np.pi, 400)
  y = np.sin(x)
  plt.plot(x, y, lw=2, c='r')
  #plt.show()
  return(np.trapz(y,x))

myplot()

Upon uncommenting the plt.show() in the snippet above, and running myplot(), a white rectangle briefly appears on the screen, which then disappears. After this, upon commenting out plt.show() again, the python inline evaluation in LightTable becomes inactive (except with a restart of LightTable). Also, the connect bar shows python and not ipython, even though both python and ipython (Anaconda distribution) are on my path, and LightTable appears to be able to see them (as illustrated in the image below): LightTablePython.png

Could it be a libpng problem (see libpng version incompatibility in fresh installation of IPython), or do I need to put ipython notebook --matplotlib=inline somewhere in the LightTable configuration?

My current version of LightTable: 0.7.2. No issues on Ubuntu 14.04.

Update: I found a partial fix, via a reinstall of Anaconda 2.1.0 (but without any of the extra packages):

rm -rf ~/anaconda
bash ~/Downloads/Anaconda-2.1.0-MacOSX-x86_64.sh 

However, a fresh re-install of Anaconda 2.2.0 did not work:

rm -rf ~/anaconda
bash ~/Downloads/Anaconda-2.2.0-MacOSX-x86_64.sh 

So obviously downgrading to Anaconda 2.1.0 is a partial fix, but in the long run, I hope to keep my packages up to date. Could there be a problem with one of the packages (screenshot of version numbers below)?

LightTable + Anaconda 2.1.0: LightTable + Anaconda 2.1.0

LightTable + Anaconda 2.2.0: LightTable + Anaconda 2.2.0

Community
  • 1
  • 1
nathanielng
  • 1,645
  • 1
  • 19
  • 30

1 Answers1

0

The main reason why inline matplotlib plot always has issues is that it uses the iPython matplotlib inline plot. Since iPython keeps changing and the core developer team [of LightTable] is no longer maintaining LightTable's python support this problem will keep on reappear.

cldwalker commented on Nov 6, 2015

The core team doesn't use Python or iPython at work and doesn't have the bandwidth to look into this. Happy to take contributions from anyone interested digging into this. We're also looking for a maintainer for the Python plugin, ideally someone who uses it for work. #31 seems like a possible solution but the contributor could use a review.

Eduard Florinescu
  • 16,747
  • 28
  • 113
  • 179