예제 #1
0
def test_plot_ticks():
    fig1, ax1 = plot_ticks(fig, ax)
    nt.ok_(len(ax1.get_xticks()) != 0)
    nt.ok_(len(ax1.get_yticks()) != 0)
    fig1, ax1 = plot_ticks(fig, ax, xticks=[], yticks=[])
    nt.ok_(len(ax1.get_xticks()) == 0)
    nt.ok_(len(ax1.get_yticks()) == 0)
    fig1, ax1 = plot_ticks(fig, ax, xticks=np.arange(3), yticks=np.arange(4))
    nt.ok_(len(ax1.get_xticks()) == 3)
    nt.ok_(len(ax1.get_yticks()) == 4)
    fig2, ax2 = plot_ticks(fig0, ax0)
    nt.ok_(len(ax2.get_zticks()) != 0)
    fig2, ax2 = plot_ticks(fig0, ax0, zticks=[])
    nt.ok_(len(ax2.get_zticks()) == 0)
    fig2, ax2 = plot_ticks(fig0, ax0, zticks=np.arange(3))
    nt.ok_(len(ax2.get_zticks()) == 3)
예제 #2
0
def test_plot_ticks():
    fig1, ax1 = plot_ticks(fig, ax)
    nt.ok_(len(ax1.get_xticks()) != 0 )
    nt.ok_(len(ax1.get_yticks()) != 0 )
    fig1, ax1 = plot_ticks(fig, ax, xticks=[], yticks=[])
    nt.ok_(len(ax1.get_xticks()) == 0 )
    nt.ok_(len(ax1.get_yticks()) == 0 )
    fig1, ax1 = plot_ticks(fig, ax, xticks=np.arange(3), yticks=np.arange(4))
    nt.ok_(len(ax1.get_xticks()) == 3 )
    nt.ok_(len(ax1.get_yticks()) == 4 )
    fig2, ax2 = plot_ticks(fig0, ax0)
    nt.ok_(len(ax2.get_zticks()) != 0 )
    fig2, ax2 = plot_ticks(fig0, ax0, zticks=[])
    nt.ok_(len(ax2.get_zticks()) == 0 )
    fig2, ax2 = plot_ticks(fig0, ax0, zticks=np.arange(3))
    nt.ok_(len(ax2.get_zticks()) == 3 )
예제 #3
0
def test_plot_ticks():
    with get_fig_2d() as (fig, ax):
        plot_ticks(ax)
        nt.ok_(len(ax.get_xticks()))
        nt.ok_(len(ax.get_yticks()))

    with get_fig_2d() as (fig, ax):
        plot_ticks(ax, xticks=[], yticks=[])
        nt.eq_(len(ax.get_xticks()), 0)
        nt.eq_(len(ax.get_yticks()), 0)

    with get_fig_2d() as (fig, ax):
        plot_ticks(ax, xticks=np.arange(3), yticks=np.arange(4))
        nt.eq_(len(ax.get_xticks()), 3)
        nt.eq_(len(ax.get_yticks()), 4)

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0)
        nt.ok_(len(ax0.get_zticks()))

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0, zticks=[])
        nt.eq_(len(ax0.get_zticks()), 0)

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0, zticks=np.arange(3))
        nt.eq_(len(ax0.get_zticks()), 3)
예제 #4
0
def test_plot_ticks():
    with get_fig_2d() as (fig, ax):
        plot_ticks(ax)
        nt.ok_(len(ax.get_xticks()))
        nt.ok_(len(ax.get_yticks()))

    with get_fig_2d() as (fig, ax):
        plot_ticks(ax, xticks=[], yticks=[])
        nt.eq_(len(ax.get_xticks()), 0)
        nt.eq_(len(ax.get_yticks()), 0)

    with get_fig_2d() as (fig, ax):
        plot_ticks(ax, xticks=np.arange(3), yticks=np.arange(4))
        nt.eq_(len(ax.get_xticks()), 3)
        nt.eq_(len(ax.get_yticks()), 4)

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0)
        nt.ok_(len(ax0.get_zticks()))

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0, zticks=[])
        nt.eq_(len(ax0.get_zticks()), 0)

    with get_fig_3d() as (fig0, ax0):
        plot_ticks(ax0, zticks=np.arange(3))
        nt.eq_(len(ax0.get_zticks()), 3)
예제 #5
0
def test_plot_ticks(get_fig_2d, get_fig_3d):
    fig, ax = get_fig_2d
    plot_ticks(ax)
    assert len(ax.get_xticks())
    assert len(ax.get_yticks())

    fig, ax = get_fig_2d
    plot_ticks(ax, xticks=[], yticks=[])
    assert len(ax.get_xticks()) == 0
    assert len(ax.get_yticks()) == 0

    fig, ax = get_fig_2d
    plot_ticks(ax, xticks=np.arange(3), yticks=np.arange(4))
    assert len(ax.get_xticks()) == 3
    assert len(ax.get_yticks()) == 4

    fig0, ax0 = get_fig_3d
    plot_ticks(ax0)
    assert len(ax0.get_zticks())

    fig0, ax0 = get_fig_3d
    plot_ticks(ax0, zticks=[])
    assert len(ax0.get_zticks()) == 0

    fig0, ax0 = get_fig_3d
    plot_ticks(ax0, zticks=np.arange(3))
    assert len(ax0.get_zticks()) == 3