Exemplo n.º 1
0
def test_multiple_plots():
    plt.ioff()
    a = StateChangeArray([0, 1, 0, 1, 0], t=[0, 5, 10, 20, 30],
                         name="a").to_bool()
    b = StateChangeArray([0, 1, 0, 1, 0], t=[0, 2, 5, 7, 15],
                         name="b").to_bool()
    c = TimeSerie(np.linspace(0, 10, 100), t0=0, fs=10, name="c")
    a.plot(b, c, align_x=True)
    return True
Exemplo n.º 2
0
def test_statechangearray_plot():
    plt.ioff()
    a = StateChangeArray([-2, -1, 0, 1, 2, 3, 4, 5],
                         t=[0, 1, 2, 3, 4, 5, 8, 10],
                         name="a")
    f = a.plot()

    b = StateChangeArray(
        [-2, -1, 0, 1, 2, 3, 4, 5],
        t=[
            dt.datetime(2019, 1, 1, 0),
            dt.datetime(2019, 1, 1, 1),
            dt.datetime(2019, 1, 1, 3),
            dt.datetime(2019, 1, 1, 6),
            dt.datetime(2019, 1, 1, 7),
            dt.datetime(2019, 1, 1, 8),
            dt.datetime(2019, 1, 1, 10),
            dt.datetime(2019, 1, 1, 11),
        ],
        name="b",
    )
    f = b.plot(as_dt=True)
    return True