plot()

CODEDRAGON Development/Python

반응형


 

 

plot()

꺾은선 그래프를 그려줍니다.

 

plt.plot([x 데이터], [y 데이터])

plt.plot( data, color ='색상', label='레이블명', linestyle="선모양")

 

parameter

description

data

데이터

kind

플롯 종류

kind

description

kind='line'

line plot (default)

kind='bar'

vertical bar plot

kind='barh'

horizontal bar plot

kind='hist

'histogram

kind='box'

boxplot

kind='kde'

Kernel Density Estimation plot

kind='density'

kind='kde' 동일

same as 'kde’

kind='area'

area plot

kind='pie'

pie plot

kind='scatter'

scatter plot

kind='hexbin'

hexbin plot.

 

label

범례 문자열

color

그래프의 색상

linestyle

or

ls

그래프의 모양

rot

눈금 회전률

 

# rot=0 : x 이름의 회전 없음

 

marker

마커 종류)

ms

마커 크기

mec

마커 색깔

mew

마커 굵기

mfc

마커 내부 색깔

 

 

 

 

 

"색과 모양" 동시 설정

'<색상><선모양>' 동시에 적는 형태로 코드를 작성할 수도 있습니다.

'<색상><선모양>'

'r--'

 

<색상><마커모양><선모양>’

'r.--'

'r^--'

 

plt.plot([1,2,3,4], 'r.--')

 

 

matplotlib.markers

https://matplotlib.org/api/markers_api.html

 

 

 

 

marker 모양

format string characters are accepted to control the line style or marker:

character

description

'-'

solid line style

'--'

dashed line style

'-.'

dash-dot line style

':'

dotted line style

'.'

point marker

','

pixel marker

'o'

circle marker

'v'

triangle_down marker

'^'

triangle_up marker

'<'

triangle_left marker

'>'

triangle_right marker

'1'

tri_down marker

'2'

tri_up marker

'3'

tri_left marker

'4'

tri_right marker

's'

square marker

'p'

pentagon marker

'*'

star marker

'h'

hexagon1 marker

'H'

hexagon2 marker

'+'

plus marker

'x'

x marker

'D'

diamond marker

'd'

thin_diamond marker

'|'

vline marker

'_'

hline marker

 

 

글자 색상

character

color

b

blue

g

green

r

red

c

cyan

m

magenta

y

yellow

k

black

w

white

 

 

 




반응형

'Development > Python' 카테고리의 다른 글

dir()  (0) 2020.02.10
클래스 메서드(class method)  (0) 2020.02.10
qcut()  (0) 2020.02.09
행 인덱스와 열 인덱스 변환  (0) 2020.02.09
피봇 테이블(Pivot table)  (0) 2020.02.09