Exemplo n.º 1
0
def test_plot(scalebar, colorbar, axes_ticks, centre_colormap):
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal.plot(scalebar=scalebar,
                          colorbar=colorbar,
                          axes_ticks=axes_ticks,
                          centre_colormap=centre_colormap)
    return test_plot.signal._plot.signal_plot.figure
def test_plot(mpl_cleanup, scalebar, colorbar, axes_ticks, centre_colormap):
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal.plot(scalebar=scalebar,
                          colorbar=colorbar,
                          axes_ticks=axes_ticks,
                          centre_colormap=centre_colormap)
    return test_plot.signal._plot.signal_plot.figure
Exemplo n.º 3
0
def test_plot(scalebar, colorbar, axes_ticks, centre_colormap, min_aspect):
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal.plot(scalebar=scalebar,
                          colorbar=colorbar,
                          axes_ticks=axes_ticks,
                          centre_colormap=centre_colormap,
                          min_aspect=min_aspect)
    return test_plot.signal._plot.signal_plot.figure
Exemplo n.º 4
0
def test_plot_two_cursos_parameters(autoscale, norm):
    kwargs = {'autoscale':autoscale, 'norm':norm}
    test_plot = _TestPlot(ndim=2, sdim=1)  # sdim=2 not supported
    s = test_plot.signal
    s.plot(**kwargs)
    s._plot.add_right_pointer(**kwargs)
    for line in s._plot.signal_plot.ax_lines:
        assert line.autoscale == autoscale
Exemplo n.º 5
0
def _test_plot_two_cursors(ndim):
    test_plot = _TestPlot(ndim=ndim, sdim=1)  # sdim=2 not supported
    test_plot.signal.plot()
    s = test_plot.signal
    s.metadata.General.title = 'Nav %i, Sig 1, two cursor' % ndim
    s.axes_manager[0].index = 4
    s.plot()
    s._plot.add_right_pointer()
    s._plot.right_pointer.axes_manager[0].index = 2
    if ndim == 2:
        s.axes_manager[1].index = 2
        s._plot.right_pointer.axes_manager[1].index = 3
    return s
Exemplo n.º 6
0
def _test_plot_two_cursors(ndim):
    test_plot = _TestPlot(ndim=ndim, sdim=1)  # sdim=2 not supported
    s = test_plot.signal
    s.metadata.General.title = 'Nav %i, Sig 1, two cursor' % ndim
    s.axes_manager[0].index = 4
    s.plot()
    s._plot.add_right_pointer()
    s._plot.navigator_plot.figure.canvas.draw()
    s._plot.signal_plot.figure.canvas.draw()
    s._plot.right_pointer.axes_manager[0].index = 2
    if ndim == 2:
        s.axes_manager[1].index = 2
        s._plot.right_pointer.axes_manager[1].index = 3
    return s
Exemplo n.º 7
0
def test_plot_log_scale():
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal += 1  # need to avoid zeros in log
    test_plot.signal.plot(norm='log')
    return test_plot.signal._plot.signal_plot.figure
Exemplo n.º 8
0
def test_plot_nav2_close():
    test_plot = _TestPlot(ndim=2, sdim=1)
    test_plot.signal.plot()
    return test_plot.signal
Exemplo n.º 9
0
def test_plot_log_scale(percentile):
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal += 1  # need to avoid zeros in log
    test_plot.signal.plot(norm='log', vmin=percentile[0], vmax=percentile[1])
    return test_plot.signal._plot.signal_plot.figure
Exemplo n.º 10
0
def test_plot_log_scale():
    test_plot = _TestPlot(ndim=0, sdim=2)
    test_plot.signal += 1  # need to avoid zeros in log
    test_plot.signal.plot(norm='log')
    return test_plot.signal._plot.signal_plot.figure
Exemplo n.º 11
0
def test_plot_nav2_close():
    test_plot = _TestPlot(ndim=2, sdim=1)
    test_plot.signal.plot()
    return test_plot.signal