五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

python3使用matplotlib和seaborn生成帶有擾動點的箱型圖

2022-12-02 17:22 作者:限量版范兒  | 我要投稿

import csvimport seaborn as snsimport matplotlib.pyplot as plt# 解決中文不顯示和負號不顯示問題rc = { ? ?'font.family': 'Microsoft YaHei', 'axes.unicode_minus': False } fig = plt.figure(figsize=(20, 5)) sns.set(style="darkgrid", rc=rc)# ------------------------------------------------------------------------------------------------------# 實例程序 加載示例數(shù)據(jù)集# df = sns.load_dataset('iris',data_home="E:\code\learn-python3\seaborn-data-master")# df.head()# ax = sns.boxplot(x='species', y='sepal_length', data=df)# ax = sns.stripplot(x='species', y='sepal_length', data=df, color="orange", jitter=0.2, size=4)# plt.title("Boxplot with jitter", loc="center")# plt.show()# ------------------------------------------------------------------------------------------------------# 讀取csv文件獲取原始數(shù)據(jù)并處理數(shù)據(jù)xData = [] yData = [] num = 2with open('./files/test.csv', encoding='utf-8-sig') as f: ? ?reader = csv.reader(f, skipinitialspace=True) ? ?headers = next(reader) ? ?for row in reader: ? ? ? ?for i in range(0, num, 1): ? ? ? ? ? ?if (len(row) == 12): ? ? ? ? ? ? ? ?xData.append(headers[6+i*2]) ? ? ? ? ? ? ? ?yData.append(float(row[6+i*2]))# boxplotax = sns.boxplot(x=xData, y=yData)# 添加擾動點ax = sns.stripplot(x=xData, y=yData, color="orange", jitter=0.2, size=4) plt.xlabel('code') plt.ylabel('value') plt.title("Boxplot with jitter", loc="center")# plt.show()plt.savefig('./files/1.jpg')

?鏈接:https://www.dianjilingqu.com/626866.html

python3使用matplotlib和seaborn生成帶有擾動點的箱型圖的評論 (共 條)

分享到微博請遵守國家法律
桓台县| 阳曲县| 定州市| 都昌县| 教育| 图木舒克市| 岢岚县| 鹿泉市| 东城区| 隆安县| 蕉岭县| 惠来县| 宜阳县| 金山区| 屏边| 合江县| 万州区| 武宁县| 福泉市| 修水县| 浦北县| 将乐县| 棋牌| 瓦房店市| 阿克陶县| 远安县| 忻州市| 盐津县| 建湖县| 芒康县| 嵊泗县| 甘德县| 来凤县| 彩票| 鹿邑县| 环江| 涡阳县| 丽江市| 朝阳区| 青河县| 克什克腾旗|