Seaborn의 포인트 플롯은 산점도 글리프를 사용하여 포인트 추정 및 신뢰 구간을 표시하는 데 사용됩니다. 이를 위해 seaborn.pointplot()이 사용됩니다. 명시적인 주문의 경우 주문을 사용하세요. pointplot() 메서드의 매개변수입니다.
다음이 CSV 파일 형식의 데이터세트라고 가정해 보겠습니다. Cricketers.csv
먼저 필요한 라이브러리를 가져옵니다 -
import seaborn as sb import pandas as pd import matplotlib.pyplot as plt
CSV 파일에서 Pandas DataFrame으로 데이터 로드 -
dataFrame = pd.read_csv("C:\\Users\\amit_\\Desktop\\Cricketers.csv") "Academy"와 "Age"로 점 플롯을 플로팅합니다. 명시적 명령을 전달하여 명령을 제어합니다. 즉 "Academy"를 기준으로 주문합니다. 주문 매개변수를 사용한 주문 -
sb.pointplot( x = 'Academy',y = 'Age', data = dataFrame, order=["Tasmania", "South Australia", "Victoria"] )
예시
다음은 전체 코드입니다 -
import seaborn as sb
import pandas as pd
import matplotlib.pyplot as plt
# Load data from a CSV file into a Pandas DataFrame
dataFrame = pd.read_csv("C:\\Users\\amit_\\Desktop\\Cricketers.csv")
sb.set_theme(style="darkgrid")
# plotting point plot with Academy and Age
# Control order by passing an explicit order i.e. ordering on the basis of "Academy"
# ordering using the order parameter
sb.pointplot( x = 'Academy',y = 'Age', data = dataFrame, order=["Tasmania", "South Australia", "Victoria"] )
# display
plt.show() 출력
이것은 다음과 같은 출력을 생성합니다 -
