python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn)(plt.figure())
本文介紹了python畫圖時(shí)設(shè)置分辨率和畫布大小的實(shí)現(xiàn),主要使用plt.figure(),下面就一起來了解一下
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’])
調(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’])
到此這篇關(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)!
相關(guān)文章:
1. JAMon(Java Application Monitor)備忘記2. SpringBoot+TestNG單元測(cè)試的實(shí)現(xiàn)3. Java GZip 基于內(nèi)存實(shí)現(xiàn)壓縮和解壓的方法4. VMware中如何安裝Ubuntu5. Springboot 全局日期格式化處理的實(shí)現(xiàn)6. python 浮點(diǎn)數(shù)四舍五入需要注意的地方7. Docker容器如何更新打包并上傳到阿里云8. IntelliJ IDEA設(shè)置默認(rèn)瀏覽器的方法9. idea配置jdk的操作方法10. 完美解決vue 中多個(gè)echarts圖表自適應(yīng)的問題
