Thursday, 1 December 2011

If matplotlib complains about the backend in OS X...

If matplotlib works fine, but will crash or give errors whenever it's supposed to plot a graph, even with a simple instruction as:

import matplotlib.pyplot as plt 
plt.plot([1,2,3,4])
plt.show()

it is likely that there is a problem with the backend that is being used.

Edit the file:

~/.matplotlib/matplotlibrc

(create it if it doesn't exist)

and add the line:

backend: MacOSX

No comments:

Post a Comment