mpl_toolkits.mplot3d.art3d.Line3D#
- class mpl_toolkits.mplot3d.art3d.Line3D(xs, ys, zs, *args, **kwargs)[源代码][源代码]#
基类:
Line2D3D 线条对象。
备注
使用
get_data_3d获取与线条关联的数据。get_data、get_xdata和get_ydata返回的是投影2D线条的x和y坐标,而不是3D线条的x和y数据。同样地,使用set_data_3d设置数据,而不是set_data、set_xdata和set_ydata。- 参数:
- xs类数组
要绘制的 x 数据。
- ys类数组
要绘制的 y 数据。
- zs类数组
要绘制的 z 数据。
- *args, **kwargs
其他参数传递给
Line2D。
- draw(renderer)[源代码][源代码]#
使用给定的渲染器绘制艺术家(及其子项)。
如果艺术家不可见(
Artist.get_visible返回 False),则此操作无效。- 参数:
- 渲染器 :
RendererBase子类。RendererBase 子类。
- 渲染器 :
注释
此方法在 Artist 子类中被重写。
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, dash_capstyle=<UNSET>, dash_joinstyle=<UNSET>, dashes=<UNSET>, data=<UNSET>, data_3d=<UNSET>, drawstyle=<UNSET>, fillstyle=<UNSET>, gapcolor=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, marker=<UNSET>, markeredgecolor=<UNSET>, markeredgewidth=<UNSET>, markerfacecolor=<UNSET>, markerfacecoloralt=<UNSET>, markersize=<UNSET>, markevery=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, solid_capstyle=<UNSET>, solid_joinstyle=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xdata=<UNSET>, ydata=<UNSET>, zorder=<UNSET>)[源代码]#
一次性设置多个属性。
支持的属性有
属性
描述
浮点数或浮点数数组
一个过滤函数,它接收一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组和两个从图像左下角开始的偏移量
标量或无
布尔值
抗锯齿或 aa布尔值
BboxBase或 None布尔值
补丁或(路径,变换)或无
颜色或 cCapStyle或 {'butt', 'projecting', 'round'}JoinStyle或 {'miter', 'round', 'bevel'}浮点数序列(开/关墨水以点为单位)或(None, None)
(2, N) 数组或两个一维数组
未知
drawstyle或 ds{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, 默认值: 'default'
{'full', 'left', 'right', 'bottom', 'top', 'none'}
color or None
str
布尔值
对象
linestyle或 ls{'-', '--', '-.', ':', '', (偏移, 开关序列), ...}
linewidth或 lw浮动
标记样式字符串,
Path或MarkerStylemarkeredgecolor或 mecmarkeredgewidth或 mew浮动
markerfacecolor或 mfcmarkerfacecoloralt或 mfcaltmarkersize或 ms浮动
None 或 int 或 (int, int) 或 slice 或 list[int] 或 float 或 (float, float) 或 list[bool]
布尔值
浮点数或可调用对象[[Artist, Event], 元组[布尔值, 字典]]
浮动
布尔值
(scale: float, length: float, randomness: float)
布尔值或无
CapStyle或 {'butt', 'projecting', 'round'}JoinStyle或 {'miter', 'round', 'bevel'}str
布尔值
1D 数组
1D 数组
浮动
- set_3d_properties(zs=0, zdir='z')[源代码][源代码]#
设置线的 z 位置和方向。
- 参数:
- zs浮点数或浮点数数组
在 3D 空间中沿 zdir 轴定位线条的位置。
- zdir{'x', 'y', 'z'}
要绘制正交线的平面。默认值:'z'。有关值的描述,请参见
get_dir_vector。