1.지원 가능한 이미지 확장자 종류를 보고 싶을 때
fig.canvas.get_supported_filetypes()
출력>
{'eps': 'Encapsulated Postscript',
'jpg': 'Joint Photographic Experts Group',
'jpeg': 'Joint Photographic Experts Group',
'pdf': 'Portable Document Format',
'pgf': 'PGF code for LaTeX',
'png': 'Portable Network Graphics',
'ps': 'Postscript',
'raw': 'Raw RGBA bitmap',
'rgba': 'Raw RGBA bitmap',
'svg': 'Scalable Vector Graphics',
'svgz': 'Scalable Vector Graphics',
'tif': 'Tagged Image File Format',
'tiff': 'Tagged Image File Format',
'webp': 'WebP Image Format'}
2. 이미지 저장
fig.savefig('파일이름.png')
3. 저장된 이미지 불러오기
이미지 다루는 모듈도 불러와야 한다.
from IPython.display import Image Image('my_figure.png')
'python > [modules] matplotlib' 카테고리의 다른 글
| 6. 그래프의 완성. 라벨과 각주( legend,선에 대한 정보 표시) (0) | 2023.04.26 |
|---|---|
| 5. 그래프 표 세부조정 (0) | 2023.04.26 |
| 4. 그래프 선 색상지정, 선의 종류 (0) | 2023.04.26 |
| 2. 그래프 두가지를 동시에 표시하기, 화면 분할하여 그래프 넣기 (0) | 2023.04.26 |
| 1. matplotlib란? 예시용 표 작성 (0) | 2023.04.26 |