mpl_toolkits.axes_grid1.mpl_axes.Axes

class mpl_toolkits.axes_grid1.mpl_axes.Axes(fig, rect, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, **kwargs)[源代码]

基类:matplotlib.axes._axes.Axes

在图形中构建轴。

参数:
figFigure图形

轴内置于 Figure fig .

rect[左、下、宽、高]

轴内置在矩形中 rect . rect 是在 Figure 协调。

斯莱西Axes 可选可选轴

X或Y axis 与输入中的X或Y轴共享 Axes .

frameonbool,默认值:True

轴框架是否可见。

box_aspect无,或数字,可选

设置轴框的纵横比。看到了吗 set_box_aspect 有关详细信息。

**kwargs

其他可选关键字参数:

财产 描述
adjustable 'box'、'datalim'
agg_filter 一种过滤函数,它接受一个(m,n,3)浮点数组和一个dpi值,并返回一个(m,n,3)数组。
alpha 浮动或无
anchor 2-浮点数或'c'、'sw'、's'、'se'、…
animated 布尔
aspect {auto}或num
autoscale_on 布尔
autoscalex_on 布尔
autoscaley_on 布尔
axes_locator 可赎回的 [[轴,渲染器]] Bbox
axisbelow 布尔或“线”
box_aspect 没有,或者是一个数字
clip_box Bbox
clip_on 布尔
clip_path 面片或(路径、变换)或无
contains 未知的
facecolor 或fc 颜色
figure Figure
frame_on 布尔
gid STR
in_layout 布尔
label 对象
navigate 布尔
navigate_mode 未知的
path_effects AbstractPathEffect
picker 无、布尔或可呼叫
position [左、下、宽、高] 或 Bbox
prop_cycle 未知的
rasterization_zorder 浮动或无
rasterized 布尔或无
sketch_params (比例:浮动,长度:浮动,随机性:浮动)
snap 布尔或无
title STR
transform Transform
url STR
visible 布尔
xbound 未知的
xlabel STR
xlim (底部:浮动,顶部:浮动)
xmargin 浮动大于-0.5
xscale “Linear”,“Log”,“SymLog”,“Logit”,…
xticklabels 未知的
xticks 未知的
ybound 未知的
ylabel STR
ylim (底部:浮动,顶部:浮动)
ymargin 浮动大于-0.5
yscale “Linear”,“Log”,“SymLog”,“Logit”,…
yticklabels 未知的
yticks 未知的
zorder 浮动
返回:
Axes

新的 Axes 对象。

class AxisDict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)[源代码]

基类:dict

__call__(*v, **kwargs)[源代码]

称自己为函数。

__dict__ = mappingproxy({'__module__': 'mpl_toolkits.axes_grid1.mpl_axes', '__init__': <function Axes.AxisDict.__init__>, '__getitem__': <function Axes.AxisDict.__getitem__>, '__call__': <function Axes.AxisDict.__call__>, '__dict__': <attribute '__dict__' of 'AxisDict' objects>, '__weakref__': <attribute '__weakref__' of 'AxisDict' objects>, '__doc__': None, '__annotations__': {}})
__getitem__(k)[源代码]

x.“获取项目”(y)<==>x [y]

__init__(axes)[源代码]

初始化自身。请参阅帮助(键入(self))以获得准确的签名。

__module__ = 'mpl_toolkits.axes_grid1.mpl_axes'
__weakref__

对象的弱引用列表(如果已定义)

__module__ = 'mpl_toolkits.axes_grid1.mpl_axes'
property axis

获取或设置某些轴属性的方便方法。

呼叫签名:

xmin, xmax, ymin, ymax = axis()
xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax])
xmin, xmax, ymin, ymax = axis(option)
xmin, xmax, ymin, ymax = axis(**kwargs)
参数:
xmin、xmax、ymin、ymax可选浮动

要设置的轴限制。也可以使用以下方法实现:

ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax))
option布尔或STR

如果是bool,则打开或关闭轴线和标签。如果是字符串,可能的值是:

价值 描述
“on” 启用轴线和标签。等同于 True .
“关” 关闭轴线和标签。等同于 False .
“平等” 通过更改轴限制来设置等比例缩放(即使圆成为圆形)。这和 ax.set_aspect('equal', adjustable='datalim') . 在这种情况下,可能不考虑显式数据限制。
“缩放” 通过更改绘图框的尺寸设置等比例缩放(即使圆成为圆形)。这和 ax.set_aspect('equal', adjustable='box', anchor='C') . 此外,将禁用进一步的自动缩放。
“紧” 设置足够大的限制以显示所有数据,然后禁用进一步的自动缩放。
“汽车” 自动缩放(用数据填充绘图框)。
“图像” 轴限制等于数据限制的“缩放”。
“广场” 方形图;类似于“按比例缩放”,但最初强制 xmax-xmin == ymax-ymin .
emitbool,默认值:True

是否通知观察者轴极限变化。此选项传递给 set_xlimset_ylim .

返回:
xmin、xmax、ymin、ymax浮动

轴限制。

cla()[源代码]

清除当前轴。