Plotting backend is set to vtk even though no vtk is present

Issue #662 resolved
Martin Sandve Alnæs created an issue

In the docker images no vtk is included, but plot still uses VTKPlotter.

Two related issues:

  • can the backend fall back to matplotlib if dolfin is not configured with vtk?

  • can the backend fall back to matplotlib if running in a jupyter notebook?

Comments (7)

  1. Martin Sandve Alnæs reporter

    Here's how to check if we're in an ipython notebook setting, contributed by Min RK:

    import sys
    
    def in_ipython_kernel():
        """Return True if in an IPython kernel, False otherwise
    
        avoids importing IPython unnecessarily.
        """
        if 'IPython' not in sys.modules:
            # IPython hasn't even been imported
            return False
        from IPython import get_ipython
        ip = get_ipython()
        if ip is None:
            # IPython isn't running
            return False
        # check for kernel attribute
        return bool(getattr(ip, 'kernel'))
    
  2. Prof Garth Wells

    @martinal Yes - I'll try to merge some X3DOM plotting today. I've seen that Python has a standard library module webbrowser for opening a browser, which will be handy.

  3. Log in to comment