def plot_tsdiffs_image(img, axes=None, show=True): ''' Plot time series diagnostics for image Parameters ---------- img : image-like or filename str image on which to do diagnostics axes : None or sequence, optional Axes on which to plot the diagnostics. If None, then we create a figure and subplots for the plots. Sequence should have length >=4. show : bool, optional If True, show the figure after plotting it Returns ------- axes : Matplotlib axes Axes on which we have done the plots. Will be same as `axes` input if not None ''' if isinstance(img, basestring): title = img else: title = 'Difference plots' img = nipy.as_image(img) res = time_slice_diffs(img) axes = plot_tsdiffs(res, axes) axes[0].set_title(title) if show: # show the plot import matplotlib.pyplot as plt plt.show() return axes
def plot_tsdiffs_image(img, axes=None, show=True): """ Plot time series diagnostics for image This function is deprecated; please use something like:: results = time_slice_diff_image(img, slice_axis=2) plot_tsdiffs(results) instead. Parameters ---------- img : image-like or filename str image on which to do diagnostics axes : None or sequence, optional Axes on which to plot the diagnostics. If None, then we create a figure and subplots for the plots. Sequence should have length >=4. show : {True, False}, optional If True, show the figure after plotting it Returns ------- axes : Matplotlib axes Axes on which we have done the plots. Will be same as `axes` input if `axes` input was not None """ if isinstance(img, string_types): title = img else: title = "Difference plots" img = nipy.as_image(img) res = time_slice_diffs(img) axes = plot_tsdiffs(res, axes) axes[0].set_title(title) if show: # show the plot import matplotlib.pyplot as plt plt.show() return axes
def plot_tsdiffs_image(img, axes=None, show=True): ''' Plot time series diagnostics for image This function is deprecated; please use something like:: results = time_slice_diff_image(img, slice_axis=2) plot_tsdiffs(results) instead. Parameters ---------- img : image-like or filename str image on which to do diagnostics axes : None or sequence, optional Axes on which to plot the diagnostics. If None, then we create a figure and subplots for the plots. Sequence should have length >=4. show : {True, False}, optional If True, show the figure after plotting it Returns ------- axes : Matplotlib axes Axes on which we have done the plots. Will be same as `axes` input if `axes` input was not None ''' if isinstance(img, string_types): title = img else: title = 'Difference plots' img = nipy.as_image(img) res = time_slice_diffs(img) axes = plot_tsdiffs(res, axes) axes[0].set_title(title) if show: # show the plot import matplotlib.pyplot as plt plt.show() return axes