Make browser plotting user-friendly

Issue #797 new
Anders Logg (Chalmers) created an issue

Plotting in the browser requires import stuff and setting obscure parameters, for example:

# pre stuff
import matplotlib
matplotlib.use('webagg')
import matplotlib.pyplot as plt
parameters['plotting_backend'] = 'matplotlib'

# plotting 
plot(v)

# post stuff
plt.show()

Put the pre stuff into the plot command (we can easily check that we do it only once).

Put the post stuff into a new function dolfin.show(). This function can instruct users how to view the plot (visit the following URL in your browser, or even fire up a new browser tab).

The current interactive() command can remain for some time with a deprecation warning and call dolfin.show().

Comments (4)

  1. Martin Sandve Alnæs

    You don't want to use webagg when in a regular notebook. Not sure how easy it is to auto-configure this.

  2. Anders Logg (Chalmers) reporter

    Our Docker containers could set some environment flag, like DOLFIN_USE_AGG or similar.

  3. Prof Garth Wells

    This report is conflating Matplotlib plotting and browser-based plotting. One step at a time.

  4. Log in to comment