Consistent plotting API
PropagationSolution.plot has a different signature to
class PropagationSolution: ... def plot( self, *args, filename=None, show=True, ignore=None, name_xoffsets=None, name_yoffsets=None, ylims=None, npts=1000, subs=None, ):
class Plotter: ... def plot( self, detectors=None, log=False, logx=False, logy=False, degrees=True, cmap=None, show=True, ):
While these are quite different in behaviour (
PropagationSolution is for traces,
Plotter is for detectors) and so you'd expect a different signature, at least the parts for saving and showing should probably be the same for the sake of the user. This is particularly useful for the CLI where a bunch of standard flags (e.g.
--save-figure myfig.png to save to file or
--no-show to not show a plot) can be supported across multiple plot-generating commands (e.g.
Perhaps all plotters should inherit some base Matplotlib plotter class that handles saving/showing a Matplotlib figure drawn by a concrete subclass?
We should probably also allow open file objects to be passed as arguments as well as path strings (again helps the CLI and is consistent with Matplotlib's