Ejemplo n.º 1
0
def test_axis_datetime_ticks(limits, n_ticks, expected_labels):
    axis = Axis(display_length=79)
    axis.nticks = n_ticks
    axis.fit(np.array(limits))
    ticklabels = axis.ticklabels

    assert list(ticklabels) == list(expected_labels)
Ejemplo n.º 2
0
def test_axis_property_setting(axis_property, value, expected_value):
    axis = Axis()
    axis = axis.fit((0, 1))
    axis.nticks = 3

    setattr(axis, axis_property, value)
    set_value = getattr(axis, axis_property)

    if isinstance(expected_value, np.ndarray):
        np.testing.assert_array_equal(set_value, expected_value)
    else:
        assert set_value == expected_value
Ejemplo n.º 3
0
def test_axis_auto_limits(x, expected_limits):
    """Check whether automatically determined limits are sensible"""
    axis = Axis(display_length=81)
    axis = axis.fit(x)
    np.testing.assert_array_equal(axis.limits, expected_limits)