In [1]:
# these are the backends on my laptop
backends = ['GTKAgg', 'GTKCairo', 'MacOSX', 'Qt4Agg', 'Qt5Agg', 'TkAgg', 'WX', 'WXAgg', 'GTK3Cairo', 'GTK3Agg', 'WebAgg', 'nbAgg', 'agg', 'cairo', 'gdk', 'pdf', 'pgf', 'ps', 'svg', 'template']

In [8]:
import matplotlib
matplotlib.__version__


Out[8]:
'2.1.2'

In [6]:
import matplotlib.pyplot as plt, numpy as np
plt.switch_backend(b)
from craftroom.displays.loupe import loupe
print("Now using {}".format(matplotlib.get_backend()))
x, y = np.meshgrid(np.linspace(0, 0.5, 50), np.linspace(0, 1, 100))
z = np.random.normal(0, 1, x.shape) + x*y*100
l = loupe()
l.setup(z)
l.run()


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/anaconda3/envs/mosasaurus/lib/python3.6/site-packages/matplotlib/backends/backend_gtk.py in <module>()
     13 try:
---> 14     import gobject
     15     import gtk; gdk = gtk.gdk

ModuleNotFoundError: No module named 'gobject'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-6-661525c6b717> in <module>()
      2 for b in backends:
      3     try:
----> 4         import matplotlib.pyplot as plt, numpy as np
      5         plt.switch_backend(b)
      6         from craftroom.displays.loupe import loupe

~/anaconda3/envs/mosasaurus/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
    114 ## Global ##
    115 
--> 116 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    117 
    118 _IP_REGISTERED = None

~/anaconda3/envs/mosasaurus/lib/python3.6/site-packages/matplotlib/backends/__init__.py in pylab_setup(name)
     58     # imports. 0 means only perform absolute imports.
     59     backend_mod = __import__(backend_name, globals(), locals(),
---> 60                              [backend_name], 0)
     61 
     62     # Things we pull in from all backends

~/anaconda3/envs/mosasaurus/lib/python3.6/site-packages/matplotlib/backends/backend_gtk.py in <module>()
     16     import pango
     17 except ImportError:
---> 18     raise ImportError("Gtk* backend requires pygtk to be installed.")
     19 
     20 pygtk_version_required = (2,4,0)

ImportError: Gtk* backend requires pygtk to be installed.

In [2]:


In [ ]:
from craftroom.displays.loupe import loupe

x, y = np.meshgrid(np.linspace(0, 0.5, 50), np.linspace(0, 1, 100))

z = np.random.normal(0, 1, x.shape) + x*y*100
l = loupe()
l.setup(z)
l.run()


        [loupe] setting up loupe
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 46.43375, 26.21874999999999
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 13.763749999999998, 37.259999999999984
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 22.0825, 13.664999999999988
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 69.2725, 18.65624999999999
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 80.1625, 40.587499999999984
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 31.157499999999995, 40.587499999999984
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 14.06625, 5.194999999999989
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 75.47375, 4.43874999999999
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 83.94375, 29.99999999999999
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 87.12, 39.37749999999998
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released
        [iplot] "c" pressed at 24.2, 37.86499999999999
        [loupe] "c" was pressed
        [loupe] 
        [loupe] your self.options include:
        [loupe]    [q]uit
        [loupe]    move the [c]rosshair, and plot slicey along it
        [loupe]    nudge the crosshair [up]
        [loupe]    nudge the crosshair [down]
        [loupe]    nudge the crosshair [left]
        [loupe]    nudge the crosshair [right]
        [iplot] waiting for a key to be pressed and released

In [ ]: