matplotlib.figure.Figure.subplots_adjust#

Figure.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[源代码]#

调整子图布局参数。

未设置的参数保持不变;初始值由 rcParams["figure.subplot.[name]"] 给出。

参数:
float, 可选

子图的左边界的相对位置,作为图宽的一部分。

float, 可选

子图的右边界的定位,作为图宽的一部分。

底部float, 可选

子图底部边缘的位置,作为图形高度的分数。

顶部float, 可选

子图顶部边缘的位置,作为图形高度的分数。

wspacefloat, 可选

子图之间的填充宽度,作为平均Axes宽度的分数。

hspacefloat, 可选

子图之间的填充高度,作为平均 Axes 高度的分数。

使用 matplotlib.figure.Figure.subplots_adjust 的示例#

标记参考

Marker reference

等高线图像

Contour image

以编程方式控制子图调整

Programmatically control subplot adjustment

断开的轴

Broken axis

相邻子图

Adjacent subplots

箱线图中的艺术家自定义

Artist customization in box plots

箱线图

Boxplots

绘制二维数据集的置信椭圆

Plot a confidence ellipse of a two-dimensional dataset

小提琴图基础

Violin plot basics

饼图条

Bar of pie

对齐 y 轴标签

Align y-labels

多行

Multiline

文本属性

Text properties

从颜色列表创建一个颜色映射

Create a colormap from a list of colors

命名颜色列表

List of named colors

带有自动缩放的线、多边形和正多边形集合

Line, Poly and RegularPoly Collection with autoscaling

带有 AxesDivider 的 Colorbar

Colorbar with AxesDivider

轴方向

Axis Direction

floating_axes 功能

floating_axes features

刻度标签对齐

Ticklabel alignment

刻度标签方向

Ticklabel direction

简单的轴方向

Simple axis direction

简单的轴刻度标签和刻度方向

Simple axis tick label and tick directions

简单轴垫

Simple axis pad

简单轴线

Simple Axisline

雷达图(又称蜘蛛图或星形图)

Radar chart (aka spider or star chart)

地形山体阴影

Topographic hillshading

具有多个y轴的脊线

Multiple y-axis with Spines

埃文斯测试

Evans test

按钮

Buttons

菜单

Menu

使用 RangeSlider 进行图像缩放

Image scaling using a RangeSlider

滑块

Slider

将滑块吸附到离散值

Snap sliders to discrete values

文本框

Textbox

绘图的生命周期

The Lifecycle of a Plot

艺术家教程

Artist tutorial

使用 cycler 进行样式设置

Styling with cycler

在 Matplotlib 中选择颜色表

Choosing Colormaps in Matplotlib

Matplotlib 中的文本

Text in Matplotlib

注解

Annotations