diff options
author | Onderwaater <onderwaa@esrf.fr> | 2015-08-18 13:41:32 +0200 |
---|---|---|
committer | Onderwaater <onderwaa@esrf.fr> | 2015-08-18 13:41:32 +0200 |
commit | f2f629ccfd6a7cf967f4af856c47fe8482f92a8b (patch) | |
tree | 2feb0c542990be2d2be287ce3271af16ce2cb3c5 | |
parent | c3c24c8ef7bc700c79a911579c7c436a36c758dd (diff) |
plotting automatic plotting of the fit
-rw-r--r-- | BINoculars/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/BINoculars/__init__.py b/BINoculars/__init__.py index 45856d4..a79f096 100644 --- a/BINoculars/__init__.py +++ b/BINoculars/__init__.py @@ -123,7 +123,13 @@ def plotspace(space, log=True, clipping=0.0, fit=None, norm=None, colorbar=True, import BINoculars.plot, BINoculars.space if isinstance(space, BINoculars.space.Space): - BINoculars.plot.plot(space, pyplot.gcf(), pyplot.gca(), log=log, clipping=clipping, fit=fit, norm=norm, colorbar=colorbar, labels=labels, **plotopts) + if fit is not None and space.dimension == 2: + ax = pyplot.gcf().add_subplot(121) + BINoculars.plot.plot(space, pyplot.gcf(), ax, log=log, clipping=clipping, fit=None, norm=norm, colorbar=colorbar, labels=labels, **plotopts) + ax = pyplot.gcf().add_subplot(122) + BINoculars.plot.plot(space, pyplot.gcf(), ax, log=log, clipping=clipping, fit=fit, norm=norm, colorbar=colorbar, labels=labels, **plotopts) + else: + BINoculars.plot.plot(space, pyplot.gcf(), pyplot.gca(), log=log, clipping=clipping, fit=fit, norm=norm, colorbar=colorbar, labels=labels, **plotopts) else: raise TypeError("'{0!r}' is not a BINoculars space".format(space)) |