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)
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())
def test_save_table(tmp_path: Path): save(data)
def test_save_pdvega(tmp_path: Path): import pdvega # noqa: F401 plot = data.vgplot.scatter("x", "y") save(plot)
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)
def test_save_altair(tmp_path: Path): plot = alt.Chart(data).mark_bar().encode(y="y", x="x") save(plot)
def test_save_bokeh(tmp_path: Path): source = ColumnDataSource(data) p = figure() p.circle(x="x", y="y", source=source) save(p)
def test_save_table(tmp_path: Path): # tests saving a DF directly to a html file save(data) # save styled table save(Styler(data))