程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python batch drawing of subgraphs + adding main title + solving Chinese garbled code

編輯:Python

import numpy as np
import pandas as pd
import time # It is used to count the running time
import copy # Use for deep copy
import _pickle as cPickle
import gc # Free up memory usage
from tqdm import tqdm,tqdm_notebook #Tqdm It's a fast one , Extensible Python Progress bar
import datetime # Processing time data
import os
import matplotlib.pyplot as plt
from matplotlib.pyplot import MultipleLocator, FormatStrFormatter
plt.rcParams['font.sans-serif']=['SimHei'] # Used to display Chinese labels normally
plt.rcParams['axes.unicode_minus']=False # Used to display negative sign normally
import seaborn as sns
%matplotlib inline
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.filterwarnings("ignore")
pd.set_option('display.max_columns',100)
pd.set_option('max_colwidth',100)
baseline_cols=['verbal_memory_baseline','visual_memory_baseline','visual-motor_speed_baseline'
,'reaction_time_baseline','impulse_control_baseline','total_symptom_baseline']
# Draw a histogram
fig = plt.figure(figsize=(15, 6))
sns.set_style("darkgrid", {'font.sans-serif': ['simhei','FangSong']}) #s Set up style
# sns.set_style('whitegrid', {'font.sans-serif': ['simhei','FangSong']})
plt.suptitle('control group Of baseline Indicator histogram ',fontsize=20) # Set the main title
for i,col in enumerate(baseline_cols):
plt.subplot(2, 3, i + 1)
plt.hist(control[col])
plt.xlabel(col,fontsize=12)
plt.tight_layout()

 


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved