Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- pandas 행 제거
- python 경우의 수
- 비선형함수 딥러닝
- EDA in python
- 판다스 조건
- sktime
- weight 일부 고정
- Prompt Tuning for Graph Neural Networks
- pytorch 데이터셋 나누기
- 선형함수 딥러닝
- pretraining
- pandas
- layer 일부 freeze
- 시계열 라이브러리
- pandas 특정 조건 열 제거
- 경우의 수 파이썬
- Does GNN Pretraining Help Molecular Representation?
- pandas 조건
- 비선형함수
- Skip connection
- pytorch dataset split
- sktime 튜토리얼
- 일부 레이어 고정
- EDA 추천 파이썬
- 모델 freeze
- sktime 예제
- Graph Theory
- pandas row 제거
- sktime tutorial
- molecular representation
Archives
- Today
- Total
MoonNote
한 개의 축에 여러 개 변수 시각화하기 본문
- 연속형 변수일 때
# Multiple box plots on one Axes fig, ax = plt.subplots(figsize=(12,10)) data = [df_0['age'], df_1['age']] labels = ['normal', 'cancer'] bp = ax.boxplot(data, vert=True, patch_artist=True) #fill with colors colors = ['lightblue', 'pink'] for patch, color in zip(bp['boxes'], colors): patch.set_facecolor(color) #adding horizontal grid lines ax.yaxis.grid(True) plt.title('Age', fontsize= 30) plt.xticks([1, 2], labels, fontsize=15) #ax.set_ylabel('Granzyme B', fontsize=15) plt.show()
- 범주형 변수일 때
-
import matplotlib.pyplot as plt # normal df_0_0 = sum(df_0['smoking'] == 0) df_0_1 = sum(df_0['smoking'] == 1) df_0_2 = sum(df_0['smoking'] == 2) # cancer df_1_0 = sum(df_1['smoking'] == 0) df_1_1 = sum(df_1['smoking'] == 1) df_1_2 = sum(df_1['smoking'] == 2) smoker = ['current', 'ex', 'non'] num = [df_0_0, df_0_1, df_0_2] num_smoker = [ [df_0_0, df_1_0], # 9, 21 [df_0_1, df_1_1], # 16, 18 [df_0_2, df_1_2] # 25, 4 ] type_smoker = ['current', 'ex', 'non'] #print(num_smoker) X = np.arange(2) fig = plt.figure() ax = fig.add_axes([0,0,1,1]) ax.bar(X + 0.00, num_smoker[0], color = 'pink', width = 0.25) ax.bar(X + 0.25, num_smoker[1], color = 'lightgreen', width = 0.25) ax.bar(X + 0.50, num_smoker[2], color = 'lightblue', width = 0.25) ax.legend(labels=type_smoker) plt.xticks([0.25, 1.25], labels, fontsize=15) plt.title('Smoking', fontsize= 20) plt.show()
'Study > Python' 카테고리의 다른 글
주소 (0) | 2021.09.09 |
---|---|
EDA library 추천: pandas-profiling (0) | 2021.08.20 |
pandas: 특정 조건의 row를 drop하기 (0) | 2021.07.17 |
pandas: 조건 일치하는 dataframe 출력 (0) | 2021.07.16 |
파이썬(Python)에서 모든 조합 구하기 (0) | 2021.07.14 |
Comments