pyfan.aws.general.path.save_img¶
-
pyfan.aws.general.path.
save_img
(plt, sna_image_name, spt_image_path=None, dpi=300, papertype='a4', orientation='horizontal', bl_upload_s3=False, st_s3_bucket=None, srt_s3_bucket_folder=None)[source]¶ Saves Graph Locally, and also upload to S3 if requested
Given figure object,
- Parameters
- plt: `matplotlib.pyplot`
a matplotlib pyplot object from a graph that was just generated
- sna_image_name: `string`
image name, without the suffix of png
- spt_image_path: `string`, optional
path to image, if None, then use default local path in
detect_store_path()
- dpi: `integer`, optional
image dpi
- papertype: `string`, optional
One of ‘letter’, ‘legal’, ‘executive’, ‘ledger’, ‘a0’ through ‘a10’, ‘b0’ through ‘b10’.
- orientation: `string`, optional
‘horizontal’ or ‘portrait’
- bl_upload_s3: `bool`, optional
if file will be uploaded to s3
- st_s3_bucket: `string`, optional
Assuming that AWS credentials are already stored in the container on EC2 or locally in a .aws credential file. So st_s3_bucket bucket name refers to bucket in the credentialed user’s s3 account.
- srt_s3_bucket_folder: `string`, optional
folder in s3 bucket to store image
- Returns
- tuple[bool, string]
returns boolean if on amzn splatform, then the directory where to store save files