日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

draw python_科学网—Draw figures with Python - 高琳琳的博文

發布時間:2023/12/10 python 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 draw python_科学网—Draw figures with Python - 高琳琳的博文 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2D histgram

import matplotlib.pyplot as plt

from matplotlib.font_manager import FontProperties

# %matplotlib inline? ? ? #Jupyter notebook在線顯示

plt.bar(['NC'], [0.6], width=0.6, facecolor='#FA8072', label='真實值')

plt.bar(['MCI', 'AD'], [0.25, 0.15], width=0.6, facecolor='#1E90FF', label='非真實值')

# width:條形圖的寬度 默認是0.8

# height:條形圖的高度

# bottom:條形底部的y坐標值 默認是0

# label:為后面設置legend做準備,為legend的名稱

#顏色表可參考網站 https://www.cnblogs.com/darkknightzh/p/6117528.html

myfont = FontProperties('STKAITI', size=14)

plt.legend(prop=myfont)? ? ? #設置legend的字體

plt.xlabel('類別', FontProperties='STKAITI', fontsize=16)

plt.ylabel('概率', FontProperties='STKAITI', fontsize=16)

plt.xticks(FontProperties='Times New Roman', size=12)

plt.yticks(FontProperties='Times New Roman', size=12)

plt.show()

References:?https://blog.csdn.net/hohaizx/article/details/79101322

轉載本文請聯系原作者獲取授權,同時請注明本文來自高琳琳科學網博客。

鏈接地址:http://blog.sciencenet.cn/blog-1969089-1208240.html

上一篇:[轉載]解決Python memory error的問題(四種解決方案)

下一篇:[轉載]國產阿爾茲海默病新藥上市 質疑得到了回應

總結

以上是生活随笔為你收集整理的draw python_科学网—Draw figures with Python - 高琳琳的博文的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。