コード例 #1
0
def test_logscale_transform_repr():
    # check that repr of log transform succeeds
    fig, ax = plt.subplots()
    ax.set_yscale('log')
    s = repr(ax.transData)

    # check that repr of log transform succeeds
    s = repr(Log10Transform(nonpos='clip'))
コード例 #2
0
ファイル: test_scale.py プロジェクト: pwuertz/matplotlib
def test_logscale_invert_transform():
    fig, ax = plt.subplots()
    ax.set_yscale('log')
    # get transformation from data to axes
    tform = (ax.transAxes + ax.transData.inverted()).inverted()

    # direct test of log transform inversion
    assert isinstance(Log10Transform().inverted(), InvertedLog10Transform)
コード例 #3
0
def test_logscale_transform_repr():
    fig, ax = plt.subplots()
    ax.set_yscale('log')
    repr(ax.transData)  # check that repr of log transform succeeds

    # check that repr of log transform succeeds
    with pytest.warns(MatplotlibDeprecationWarning):
        repr(Log10Transform(nonpos='clip'))
コード例 #4
0
ファイル: test_scale.py プロジェクト: pwuertz/matplotlib
def test_logscale_transform_repr():
    # check that repr of log transform succeeds
    fig, ax = plt.subplots()
    ax.set_yscale('log')
    s = repr(ax.transData)

    # check that repr of log transform returns correct string
    s = repr(Log10Transform(nonpos='clip'))
    assert s == "Log10Transform({!r})".format('clip')