cachai.utilities.chsave
- cachai.utilities.chsave(name='figure', dir_path='images', pdf=True, img_dpi=300, pdf_dpi=200)[source]
Saves the current matplotlib figure as PNG and optionally PDF with customizable dpi (dots per inch).
- Parameters
- name
str The name of the figure. The image is saved as “dir_path/name.png” (default: “figure”).
- name
- Other Parameters
- dir_path
str Path to the directory where the image is saved. If it doesn’t exist, it will be created (default: “images”)
- pdf
bool Whether to also save the image as a PDF.
- img_dpi
int The dpi of the PNG image.
- pdf_dpi
int The dpi of the PDF image.
- dir_path
Examples
import cachai.utilities as chu plt.figure(figsize=(10,10)) plt.scatter([1,2,3],[1,4,9],color="magenta") chu.chsave("my_plot")