Пример #1
0
def test_save_base(tmp_path: Path, monkeypatch):
    # absolute filename tests
    # test with no filename
    save(data)
    save(data)

    # relative filename tests
    monkeypatch.chdir(tmp_path)
    save(data)
Пример #2
0
def test_save_matplotlib(tmp_path: Path):
    pd.set_option("plotting.backend", "matplotlib")
    fig, ax = plt.subplots()
    data.plot.scatter("x", "y", ax=ax)
    # test svg default
    save(fig)
    # test save axes only
    save(ax)
    # test save ndarray
    save(data.hist())
Пример #3
0
def test_save_table(tmp_path: Path):
    save(data)
Пример #4
0
def test_save_pdvega(tmp_path: Path):
    import pdvega  # noqa: F401

    plot = data.vgplot.scatter("x", "y")
    save(plot)
Пример #5
0
def test_save_altair_pandas(tmp_path: Path):
    pd.set_option("plotting.backend",
                  "altair")  # Installing altair_pandas registers this.
    plot = data.plot.scatter("x", "y")
    save(plot)
Пример #6
0
def test_save_altair(tmp_path: Path):
    plot = alt.Chart(data).mark_bar().encode(y="y", x="x")
    save(plot)
Пример #7
0
def test_save_bokeh(tmp_path: Path):
    source = ColumnDataSource(data)
    p = figure()
    p.circle(x="x", y="y", source=source)
    save(p)
Пример #8
0
def test_save_table(tmp_path: Path):
    # tests saving a DF directly to a html file
    save(data)
    # save styled table
    save(Styler(data))