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. java實(shí)現(xiàn)圖形化界面計(jì)算器2. IntelliJ Idea2017如何修改緩存文件的路徑3. IntelliJ IDEA設(shè)置條件斷點(diǎn)的方法步驟4. IIS Express 取代 ASP.NET Development Server的配置方法5. python flask框架快速入門6. Spring-Richclient 0.1.0 發(fā)布7. javascript設(shè)計(jì)模式 ? 建造者模式原理與應(yīng)用實(shí)例分析8. 淺談SpringMVC jsp前臺(tái)獲取參數(shù)的方式 EL表達(dá)式9. Python使用oslo.vmware管理ESXI虛擬機(jī)的示例參考10. Express 框架中使用 EJS 模板引擎并結(jié)合 silly-datetime 庫進(jìn)行日期格式化的實(shí)現(xiàn)方法
