python 子图大小_Python | 图的大小
python 子图大小
In some cases, the automatic figure size generated by the matplotlib.pyplot is not visually good or there could be some non-acceptable ratio in the figure. So, rather than allowing a pyplot to decide the figure size, we can manually define the dimensions of the figure.
在某些情况下,由matplotlib.pyplot生成的自动图形大小在视觉上不佳,或者图形中可能存在某些不可接受的比例。 因此,我们可以手动定义图形的尺寸,而不是允许pyplot来确定图形的尺寸。
In this article, we are going to change figure size using an inbuilt function:
在本文中,我们将使用内置函数来更改图形大小 :
matplotlib.pyplot.figure(figsize)
Syntax:
句法:
matplotlib.pyplot.figure(figsize=(9,3))
# figsize(float, float)
width, height in inches.
1)宽身材 (1) Wide Figure)
![](/assets/blank.gif)
2)高地 (2) Tall Plot)
![](/assets/blank.gif)
3)小方形图 (3) Small Square Figure)
![](https://www.includehelp.com/python/images/figure-size-of-plot-3.jpg)
4)方形图 (4) Square Figure)
![](/assets/blank.gif)
绘图图形大小的Python代码 (Python code for figure size of plot)
# Data Visualization using Python
# Figure Size
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(50)
y = 2*x*x + 7*x - 14
# Example 1
plt.figure(figsize=(9,5))
# Leftmost
plt.plot(x, y, 'yo')
plt.title('Plot')
plt.ylabel('Function Vaule')
plt.xlabel('x-axis')
plt.show()
# Example 2
plt.figure(figsize=(6,9))
# Leftmost
plt.plot(x, y, 'yo')
plt.title('Plot')
plt.ylabel('Function Vaule')
plt.xlabel('x-axis')
plt.show()
# Example 3
plt.figure(figsize=(3,3))
# Leftmost
plt.plot(x, y, 'yo')
plt.title('Plot')
plt.ylabel('Function Vaule')
plt.xlabel('x-axis')
plt.show()
# Example 4
plt.figure(figsize=(7,7))
# Leftmost
plt.plot(x, y, 'yo')
plt.title('Plot')
plt.ylabel('Function Vaule')
plt.xlabel('x-axis')
plt.show()
Output:
输出:
Output is as figure
翻译自: https://www.includehelp.com/python/figure-size-of-plot.aspx
python 子图大小
python 子图大小_Python | 图的大小相关推荐
- python设置散点图点的大小_python散点图区域大小比例轴长度
首先,标记的大小以点为单位,而不是以像素为单位 . 在排版中,the point是最小的度量单位,在matplotlib中对应于1/72英寸的固定长度 . 相反,像素的大小将根据图形dpi和大小而变化 ...
- python 比较数字大小_Python:整数比较大小和输出 | 学步园
问题:题目:输入三个整数x,y,z,请把这三个数由小到大输出. 程序分析:我们想办法把最小的数放到x上,先将x与y进行比较,如果x>y则将x与y的值进行交换, 然后再用x与z进行比较,如果x&g ...
- python 图片大小_python 区分图像大小(A2、A3、A4)
说明,本人对象负责的项目有大量的加工图像,分别有A2 A3 A4 等规格,且这些图像都是在一起存储,按照相关的档案顺序全组:现在让我分别统计一共的图像数量 以及A2 A3 A4数量,经过一晚努力,现将 ...
- python子图命名_python – 用于子图的plt.setp替代或如何在x轴...
我有这个代码,我可以控制以下属性:x轴范围,标题,xlabel,ylabel,图例,网格,x标签上文字的旋转: #!/usr/bin/python import datetime import num ...
- python子图标题_python, 如何在subplot在总的图画上面加title?
展开全部 python, 在subplot在总的图画上面加title的方法:画完子图在下面加plt.suptitle() Python , 是一种面向对象的解释型计算机程序设计语言,由荷e5a48de ...
- python设置坐标轴刻度值字体大小_python 设置xlabel,ylabel 坐标轴字体大小,字体类型...
本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...
- python字体类型_python 设置xlabel,ylabel 坐标轴字体大小,字体类型
本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...
- python字体大小_python 设置xlabel,ylabel 坐标轴字体大小,字体类型
本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...
- Python 基础 之 词云(词的频率统计大小成图)的简单实现(包括图片词云,词云颜色,词的过滤)
Python 基础 之 词云(词的频率统计大小成图)的简单实现(包括图片词云,词云颜色,词的过滤) 目录
最新文章
- dataframe 按条件删行_根据列值删除Pandas中的DataFrame行
- jquery简单使用入门
- spring第五讲:aop
- 【Python金融量化 7- 100 】、七、计算两只股票方差和相关性
- LeetCode 9 回文数
- Linux的Nginx七:对比|模块
- Ubuntu16.04-LTS升级到18.04
- 修改vim中的tab为4个空格
- WeihanLi.Npoi 1.7.0 更新介绍
- 前端学习(2556):vue插槽
- python接口自动化(九)--python中字典和json的区别(详解)
- 个人地理数据库与文件地理数据库的区别
- ApiDoc 一键生成注释
- java私塾 shiro_第二章:Shiro入门——深入浅出学Shiro细粒度权限开发框架——私塾在线原创...
- Mysql 查询根节点下所有叶子节点
- 百度常用搜索语法 超详解
- .net c#通过Exif获取图片信息(参数)
- 【Translate插件】报错:更新TTK失败,请检查网络连接问题
- 前缀和【一维前缀和与二维前缀和】
- iSAM1论文推导学习--第二节QR部分
热门文章
- Hey,孙叫兽的2020 CSDN年度报告已出炉,请查收!
- 【APICloud系列|31】百度导航功能的实现
- 通过暴露出来的OA和github信息拿Shell
- php order by where,无合适where条件过滤时尽量选择order by后的字段以驱动表进行查询...
- WEB页面的生命周期,DOMContentLoaded,load,beforeunload,unload
- 课时105.边框属性下(掌握)
- canvas离屏技术与放大镜实现
- mybatis 直接执行sql 【我】
- bzoj 2007 [Noi2010]海拔——最小割转最短路
- SAS笔记(6) PROC MEANS和PROC FREQ