일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- SQL
- google apps script
- Java
- math
- matplotlib
- Github
- array
- Python
- PostgreSQL
- numpy
- Google Excel
- PANDAS
- PySpark
- Kotlin
- dataframe
- Tkinter
- Excel
- gas
- 파이썬
- Mac
- Apache
- Redshift
- hive
- django
- c#
- string
- Google Spreadsheet
- GIT
- list
- Today
- Total
목록2024/03 (20)
달나라 노트
matplotlib에서는 좌표평면 위에 다각형을 그릴 수 있는 기능도 제공합니다. 이는 좌표평면 위에 그려진 그래프와는 별개의 다각형을 그릴 수 있는 기능입니다. Syntax plt.Polygon( xy=list_poly_coords, # 다각형 꼭지점 좌표 alpha=1, # 투명도 fill=True, # True -> 채우기, False -> 채우기 안함 color='forestgreen', # 종합적인 색상 -> 테두리 색상과 채우기 색상 동시에 결정 facecolor='red', # 채우기 색상 edgecolor='black', # 테두리 색상 linestyle='solid', # 테두리 스타일 {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} lin..
x축을 숨기거나 y축을 숨기거나 아니면 그냥 좌표평면 자체를 숨겨버리는 기능을 알아봅시다. import matplotlib.pyplot as plt sub_plots = plt.subplots(2, 2) fig = sub_plots[0] graph = sub_plots[1] fig.suptitle('Axis off test') fig.tight_layout(pad=3) graph[0][0].set_title('original') graph[0][1].set_title('x axis off') graph[0][1].xaxis.set_visible(False) graph[1][0].set_title('y axis off') graph[1][0].yaxis.set_visible(False) graph[1][1..
numpy의 power method는 거듭제곱을 계산해줍니다. Syntax numpy.power(a, b) power는 위처럼 사용할 수 있고 a ^ b의 결과를 계산해줍니다. import numpy as np print(np.power(2, 3)) -- Result 8 2 ^ 3 = 8 을 계산한 것을 볼 수 있습니다.
matplotlib의 text method는 그래프에 텍스트를 그릴 수 있게 해줍니다. import matplotlib.pyplot as plt list_x = [10, 20, 30, 40, 50] list_y = [10, 30, 15, 20, 5] plt.plot(list_x, list_y, color='skyblue', marker='o', markerfacecolor='blue', markersize=6) plt.xlim(0, 60) plt.ylim(0, 40) plt.text(x=0, y=0, # text box를 표시할 x, y좌표. (이것은 그래프 속 좌표와 동일.) s='Test text', # 표시할 text fontsize=20, # text 크기 horizontalalignment='l..