成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn)(plt.figure())

瀏覽:107日期:2022-06-30 10:09:58

本文介紹了python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn),主要使用plt.figure(),下面就一起來(lái)了解一下

plt.figure()

示例:

import numpy as npimport pandas as pdimport warningswarnings.filterwarnings(’ignore’)import matplotlib.pyplot as pltimport seaborn as sns#讀取示例數(shù)據(jù)df = pd.read_csv( ’https://labfile.oss.aliyuncs.com/courses/1283/telecom_churn.csv’)#sns.countplot(x=’State’, hue=’Churn’, data=df)#畫分布圖sns.countplot(x=df[’State’], hue=df[’Churn’])

python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn)(plt.figure())

調(diào)整后:

# 分辨率參數(shù)-dpi,畫布大小參數(shù)-figsizeplt.figure(dpi=300,figsize=(24,8))# 改變文字大小參數(shù)-fontsizeplt.xticks(fontsize=10)#畫分布圖sns.countplot(x=df[’State’], hue=df[’Churn’])

python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn)(plt.figure())

到此這篇關(guān)于python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn)(plt.figure())的文章就介紹到這了,更多相關(guān)python 設(shè)置分辨率和畫布內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Python 編程
相關(guān)文章: