python画图时设置分辨率和画布大小的实现(plt.figure())
作者:白小斗 时间:2022-11-09 18:12:17
本文介绍了python画图时设置分辨率和画布大小的实现,主要使用plt.figure(),下面就一起来了解一下
plt.figure()
示例:
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
import seaborn as sns
#读取示例数据
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'])
调整后:
# 分辨率参数-dpi,画布大小参数-figsize
plt.figure(dpi=300,figsize=(24,8))
# 改变文字大小参数-fontsize
plt.xticks(fontsize=10)
#画分布图
sns.countplot(x=df['State'], hue=df['Churn'])
来源:https://blog.csdn.net/yinjieer379/article/details/109510553
标签:python,分辨率,画布
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python轻松破解加密压缩包教程详解
2021-04-12 13:26:45
![](https://img.aspxhome.com/file/2023/3/71393_0s.png)
elementUI el-table二次封装的详细实例
2024-05-03 15:12:00
![](https://img.aspxhome.com/file/2023/0/130190_0s.png)
position两三事
2009-02-16 15:23:00
JS实现普通轮播图特效
2024-04-17 10:19:52
![](https://img.aspxhome.com/file/2023/2/136312_0s.jpg)
centos下安装配置phpMyAdmin的方法步骤
2023-11-09 01:27:11
如何优化JavaScript脚本的性能
2008-02-19 21:47:00
python回溯法实现数组全排列输出实例分析
2023-06-18 20:42:27
Select的OnChange()事件
2009-03-03 12:40:00
python使用pygame创建精灵Sprite
2021-04-20 06:44:35
![](https://img.aspxhome.com/file/2023/9/101609_0s.png)
详解Python函数print用法
2023-06-10 03:47:34
![](https://img.aspxhome.com/file/2023/6/112396_0s.png)
防止网站内容被人小偷和采集的ASP代码
2007-10-02 13:04:00
基于jsp实现新闻管理系统 附完整源码
2023-07-10 15:35:53
![](https://img.aspxhome.com/file/2023/2/61352_0s.png)
python导入不同目录下的自定义模块过程解析
2022-11-08 16:05:47
![](https://img.aspxhome.com/file/2023/7/86537_0s.png)
使用jQuery向asp.net Mvc传递复杂json数据-ModelBinder篇
2024-06-05 09:32:20
![](https://img.aspxhome.com/file/2023/3/122783_0s.jpg)
Python 下载Bing壁纸的示例
2023-11-20 00:14:41
![](https://img.aspxhome.com/file/2023/8/64598_0s.png)
利用xmlhttp和adodb.stream加缓存技术下载远程Web文
2009-04-23 18:33:00
FCKeditor的几点修改小结
2023-05-15 22:13:09
什么是响应式Web设计?怎样进行?
2011-11-21 17:00:40
PHP禁止页面缓存的代码
2023-07-04 05:35:02
Python Pyperclip模块安装和使用详解
2023-06-25 13:52:11