Exemplo n.º 1
0
def test_axis_artist():
    global axisline

    #self._axislines[loc] = new_fixed_axis(loc=loc, axes=axes)
    from mpl_toolkits.axisartist import AxisArtistHelperRectlinear
    fig = plt.figure(1)
    fig.clf()
    ax=fig.add_subplot(111)
    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)

    if 1:

        _helper = AxisArtistHelperRectlinear.Fixed(ax, loc="left")
        axisline = AxisArtist(ax, _helper, offset=None, axis_direction="left")
        ax.add_artist(axisline)
        _helper = AxisArtistHelperRectlinear.Fixed(ax, loc="right")
        axisline = AxisArtist(ax, _helper, offset=None, axis_direction="right")
        ax.add_artist(axisline)

    _helper = AxisArtistHelperRectlinear.Fixed(ax, loc="bottom")
    axisline = AxisArtist(ax, _helper, offset=None, axis_direction="bottom")
    axisline.set_label("TTT")
    #axisline.label.set_visible(False)
    ax.add_artist(axisline)

    #axisline.major_ticklabels.set_axis_direction("bottom")
    axisline.major_ticks.set_tick_out(False)

    ax.set_ylabel("Test")

    axisline.label.set_pad(5)


    plt.draw()
Exemplo n.º 2
0
def test_axis_artist():
    fig, ax = plt.subplots()

    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)

    for loc in ('left', 'right', 'bottom'):
        _helper = AxisArtistHelperRectlinear.Fixed(ax, loc=loc)
        axisline = AxisArtist(ax, _helper, offset=None, axis_direction=loc)
        ax.add_artist(axisline)

    # Settings for bottom AxisArtist.
    axisline.set_label("TTT")
    axisline.major_ticks.set_tick_out(False)
    axisline.label.set_pad(5)

    ax.set_ylabel("Test")
Exemplo n.º 3
0
def test_axis_artist():
    # Remove this line when this test image is regenerated.
    plt.rcParams['text.kerning_factor'] = 6

    fig, ax = plt.subplots()

    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)

    for loc in ('left', 'right', 'bottom'):
        _helper = AxisArtistHelperRectlinear.Fixed(ax, loc=loc)
        axisline = AxisArtist(ax, _helper, offset=None, axis_direction=loc)
        ax.add_artist(axisline)

    # Settings for bottom AxisArtist.
    axisline.set_label("TTT")
    axisline.major_ticks.set_tick_out(False)
    axisline.label.set_pad(5)

    ax.set_ylabel("Test")