zerohertzLib.plot.util ¶
Functions:
| Name | Description |
|---|---|
color | 색 추출 function |
figure | Graph 생성을 위한 function |
savefig | Graph 저장 function |
subplot | Subplot 생성을 위한 function |
_color ¶
Data 시각화를 위한 색상 처리 helper function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | Any | 시각화할 data | required |
colors | Any | 사용할 색상 설정 | required |
Returns:
| Type | Description |
|---|---|
list[tuple[float, float, float] | str] | 처리된 색상 리스트 |
Source code in zerohertzLib/plot/util.py
color ¶
color(cnt: int = 1, rand: bool = False, uint8: bool = False, palette: str = 'husl') -> tuple[float, float, float] | list[int] | list[tuple[float, float, float]] | list[list[int]]
색 추출 function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cnt | int | 추출할 색의 수 | 1 |
rand | bool | Random 추출 여부 | False |
uint8 | bool | 출력 색상의 type | False |
palette | str | 추출할 색들의 palette | 'husl' |
Returns:
| Type | Description |
|---|---|
tuple[float, float, float] | list[int] | list[tuple[float, float, float]] | list[list[int]] | 단일 색 또는 list로 구성된 여러 색 |
Examples:
>>> zz.plot.color()
(0.9710194877714075, 0.4645444048369612, 0.21958695134807432)
>>> zz.plot.color(4)
[(0.9677975592919913, 0.44127456009157356, 0.5358103155058701), (0.5920891529639701, 0.6418467016378244, 0.1935069134991043), (0.21044753832183283, 0.6773105080456748, 0.6433941168468681), (0.6423044349219739, 0.5497680051256467, 0.9582651433656727)]
>>> zz.plot.color(4, True)
[(0.22420518847992715, 0.6551391052055489, 0.8272616286387289), (0.9677975592919913, 0.44127456009157356, 0.5358103155058701), (0.21125140522513897, 0.6760830215342485, 0.6556099802889619), (0.9590000285927794, 0.36894286394742526, 0.9138608732554839)]
>>> zz.plot.color(uint8=True)
[53, 172, 167]
>>> zz.plot.color(4, uint8=True)
[[246, 112, 136], [150, 163, 49], [53, 172, 164], [163, 140, 244]]
>>> zz.plot.color(4, True, True)
[[247, 117, 79], [73, 160, 244], [54, 171, 176], [110, 172, 49]]
Source code in zerohertzLib/plot/util.py
figure ¶
Graph 생성을 위한 function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
figsize | tuple[int, int] | Graph의 가로, 세로 길이 | (15, 10) |
Returns:
| Type | Description |
|---|---|
Figure | Graph window 생성 |
Examples:
>>> zz.plot.figure()
<Figure size 1500x1000 with 0 Axes>
>>> zz.plot.figure((20, 20))
<Figure size 2000x2000 with 0 Axes>
Source code in zerohertzLib/plot/util.py
savefig ¶
Graph 저장 function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title | str | Graph file 이름 | required |
dpi | int | Graph 저장 시 DPI (Dots Per Inch) | 300 |
Returns:
| Type | Description |
|---|---|
str | 저장된 graph의 절대 경로 |
Examples:
Source code in zerohertzLib/plot/util.py
subplot ¶
Subplot 생성을 위한 function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args | Any | matplotlib.pyplot.subplot의 위치 인수들 | () |
**kwargs | Any | matplotlib.pyplot.subplot의 키워드 인수들 | {} |
Returns:
| Type | Description |
|---|---|
Axes | Subplot axes 생성 |
Examples: