일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- google apps script
- hive
- Redshift
- Excel
- SQL
- gas
- Mac
- GIT
- Python
- c#
- list
- numpy
- math
- PANDAS
- Google Spreadsheet
- Tkinter
- Apache
- PySpark
- matplotlib
- django
- Github
- Google Excel
- dataframe
- Kotlin
- Java
- PostgreSQL
- 파이썬
- string
- array
- Today
- Total
목록xticks (2)
달나라 노트
import matplotlib.pyplot as plt list_x = [] for i in range(10): list_x.append(i+1) list_y = [] for i in list_x: list_y.append(i + 10) plt.plot(list_x, list_y, color='skyblue', marker='o', markerfacecolor='blue', markersize=6) plt.show() 위 코드를 실행해보면 그래프가 잘 그려집니다. 그래프에 찍힌 점을 보면 총 10개의 점이 있습니다. 각 점의 x좌표는 1, 2, 3, ... , 10 입니다. 근데 matplotlib는 그냥 대략적으로 알아서 x축 좌표를 생략하여 표시해줍니다. 그래서 위 그래프의 x축을 보면 2, 4, ..
import matplotlib.pyplot as plt list_x = [ '2022-01-01', '2022-01-02', '2022-01-03', '2022-01-04', '2022-01-05', '2022-01-06', '2022-01-07', '2022-01-08' ] list_y = [10, 2, 8, 4, 6, 5, 6, 4] plt.plot(list_x, list_y, color='skyblue', marker='o', markerfacecolor='blue', markersize=6) plt.show() 위 코드를 실행시키면 아래와 같은 결과가 나옵니다. 그래프 자체는 제대로 그려진거같은데, x축의 값이 겹쳐서 보이죠. x축을 날짜를 나타내는데 날짜를 나타내는 텍스트의 길이가 길어서 일부..