Пример #1
0
def test_set_axis_to_percent_pcs():
    ''' format set axis tick to percentage with precision. '''
    fig = plt.figure()
    ax = fig.gca()

    sin_plot(ax)
    ax.set_yticks(np.linspace(-100, 100, 11, endpoint=True) / 100.)

    fmt.set_axis_to_percent(ax.yaxis, precision=2)
Пример #2
0
def test_set_axis_to_percent_pplot():
    ''' format set axis tick to percentage with paper plot. '''
    fmt.paper_plot()

    fig = plt.figure()
    ax = fig.gca()

    sin_plot(ax)
    ax.set_yticks(np.linspace(-100, 100, 11, endpoint=True) / 100.)

    fmt.set_axis_to_percent(ax.yaxis)
Пример #3
0
def test_set_axis_to_percent_tex():
    ''' format set axis tick to percentage with Tex. '''
    fig = plt.figure()
    ax = fig.gca()

    skip_if_without_tex()
    matplotlib.rcParams['text.usetex'] = True

    sin_plot(ax)
    ax.set_yticks(np.linspace(-100, 100, 11, endpoint=True) / 100.)

    fmt.set_axis_to_percent(ax.yaxis)