データ分析と可視化
16471 ワード
4.デザイン
4-1. マーク
Matplotlib-タグリンク
4-2. 線スタイル
Matplotlib-LineStyleリンク
4-3. Color
Matplotlib-Colorリンク
4-4. 書式設定
4-5. 略語
Matplotlib-略語リンク
4-6. 透明度
4-7. グラフィックサイズ
4-8. 背景色
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family'] = 'Malgun Gothic' #windows
matplotlib.rcParams['font.size'] = 15
matplotlib.rcParams['axes.unicode_minus'] = False
x = [1, 2, 3]
y = [2, 4, 8]
plt.plot(x,y)

plt.plot(x,y, linewidth = 5)# 선두께 두껍게

4-1. マーク
Matplotlib-タグリンク
plt.plot(x,y,marker='o')

plt.plot(x,y,marker='o', linestyle='None')

plt.plot(x,y,marker='v')

plt.plot(x,y,marker='v', markersize =10) # 마커사이즈 키우기

plt.plot(x, y, marker='X', markersize=10, markeredgecolor = 'red')

plt.plot(x, y, marker='o', markersize=20, markeredgecolor = 'red', markerfacecolor = 'yellow')

4-2. 線スタイル
Matplotlib-LineStyleリンク
plt.plot(x,y,linestyle=':')

plt.plot(x,y,linestyle='--')

plt.plot(x,y,linestyle='-.')

4-3. Color
Matplotlib-Colorリンク
plt.plot(x,y,color='pink')

plt.plot(x,y,color='#ff0000')

plt.plot(x,y,color='b')

plt.plot(x,y,color='g')

4-4. 書式設定
plt.plot(x,y,'ro--') #color, marker, linestyle

plt.plot(x,y,'bv:')

plt.plot(x,y,'go')

plt.plot(x,y, color= 'g', marker='o', linestyle='None')

4-5. 略語
Matplotlib-略語リンク
plt.plot(x,y,marker='o',mfc='red',ms=10, mec='blue', ls=':')

4-6. 透明度
plt.plot(x,y,marker='o',mfc='red',ms=10, alpha=0.3) # alpha : 투명도(0~1)

4-7. グラフィックサイズ
plt.figure(figsize=(10, 5))
plt.plot(x, y)

plt.figure(figsize=(5, 10))
plt.plot(x, y)

plt.figure(figsize=(10, 5), dpi = 50)
#dpi해상도 - 인치당 도트수(dots per inch, 확대)
plt.plot(x,y)

4-8. 背景色
plt.figure(facecolor = 'yellow')
plt.plot(x,y)

plt.figure(facecolor = '#a1c3ff')#RGB값
plt.plot(x,y)

Reference
この問題について(データ分析と可視化), 我々は、より多くの情報をここで見つけました https://velog.io/@ssjy89/나도코딩-데이터-분석-및-시각화-Matplotlib2テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol