MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / save_plot

Function save_plot

test/cluster-spec-sheet/mzcompose.py:4436–4449  ·  view source on GitHub ↗
(plot_dir: str, data_frame: pd.DataFrame, title: str, slug: str)

Source from the content-addressed store, hash-verified

4434
4435
4436def save_plot(plot_dir: str, data_frame: pd.DataFrame, title: str, slug: str):
4437 all_files = []
4438
4439 base_file_name = os.path.join(plot_dir, slug)
4440 file_path = f"{base_file_name}.svg"
4441 plt.savefig(MZ_ROOT / file_path, bbox_inches="tight")
4442 all_files.append(file_path)
4443 file_path = f"{base_file_name}.html"
4444 data_frame.to_html(MZ_ROOT / file_path)
4445 all_files.append(file_path)
4446 print(f"+++ Plot for {title}")
4447 print(data_frame.to_string())
4448
4449 upload_file(all_files, title)
4450
4451
4452def upload_file(

Callers 2

plotFunction · 0.85

Calls 4

upload_fileFunction · 0.85
joinMethod · 0.45
appendMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected