Example #1
0
def test_alpha_palette():
    s = scale_alpha_discrete()
    items = s.palette(9)
    assert (len(items) == 9)

    s = scale_alpha_continuous(range=(0.1, 1))
    value = s.palette(0.5)
    assert (value == (0.1 + 1) / 2.0)
Example #2
0
def test_alpha_palette():
    s = scale_alpha_discrete()
    items = s.palette(9)
    assert(len(items) == 9)

    s = scale_alpha_continuous(range=(0.1, 1))
    value = s.palette(0.5)
    assert(value == (0.1+1)/2.0)
Example #3
0
def test_alpha_palette():
    with pytest.warns(PlotnineWarning):
        s = scale_alpha_discrete()
        items = s.palette(9)
        assert(len(items) == 9)

    s = scale_alpha_continuous(range=(0.1, 1))
    value = s.palette(0.5)
    assert(value == (0.1+1)/2.0)