Pyplot 튜토리얼

1 개요[ | ]

Pyplot 튜토리얼

2 예제 1[ | ]

import matplotlib.pyplot as plt
x = ['Jan','Feb','Mar','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.bar(x, sales)
plt.show()

Pyplot-20190925-1.png

3 예제 2[ | ]

import matplotlib.pyplot as plt
x = ['Jan','Feb','Mar','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.plot(x, sales)
plt.show()

Pyplot-20190925-2.png

4 예제 3[ | ]

import matplotlib.pyplot as plt
x = ['Jan','Feb','Mar','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.bar(x, sales)
plt.plot(x, sales)
plt.show()

Pyplot-20190925-3.png

5 예제 4[ | ]

import matplotlib.pyplot as plt
x = ['Jan','Feb','Mar','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.bar(x, sales, width=0.6, color="red")
plt.plot(x, sales)
plt.show()

Pyplot-20190925-4.png

6 예제 5[ | ]

import matplotlib.pyplot as plt
x = ['Jan','Feb','Mar','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.bar(x, sales, width=0.6, color="red")
plt.plot(x, sales)
plt.title('Sales Per Day')
plt.ylabel('Sales')
plt.xlabel('Day')
plt.show()

Pyplot-20190925-5.png

7 예제 6[ | ]

import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
malgunbd15 = fm.FontProperties(fname='C:/Windows/Fonts/malgunbd.ttf',size=15)
x = ['Jan','Tue','Wed','Thr','Fri','Sat','Sun']
sales = [314,159,265,358,979,323,846]
plt.plot(x, sales, alpha=0.5)
plt.bar(x, sales, width=0.6, color="gray", alpha=0.5)
plt.xlabel('요일', fontproperties=malgunbd15)
plt.ylabel('판매량', fontproperties=malgunbd15)
plt.title('일별 판매량', fontproperties=malgunbd15)
plt.show()

Pyplot-20190925-6.png

8 예제 7[ | ]

import matplotlib
import matplotlib.pyplot as plt
malgunbd = matplotlib.font_manager.FontProperties(fname='C:/Windows/Fonts/malgunbd.ttf')
matplotlib.rc('font', family=malgunbd.get_name(), size=15)
x = ['월','화','수','목','금','토','일']
sales = [314,159,265,358,979,323,846]
plt.plot(x, sales, alpha=0.5)
plt.bar(x, sales, width=0.6, color="gray", alpha=0.5)
plt.xlabel('요일', fontproperties=malgunbd)
plt.ylabel('판매량', fontproperties=malgunbd)
plt.title('일별 판매량',fontproperties=malgunbd)
plt.show()

Pyplot-20190925-7.png

9 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}