plot#

k3d.factory.plot(height=512, antialias=3, logarithmic_depth_buffer=True, background_color=16777215, camera_auto_fit=True, grid_auto_fit=True, grid_visible=True, screenshot_scale=2.0, grid=(- 1, - 1, - 1, 1, 1, 1), grid_color=15132390, label_color=4473924, lighting=1.5, menu_visibility=True, voxel_paint_color=0, colorbar_object_id=- 1, camera_fov=60.0, time=0.0, axes=['x', 'y', 'z'], axes_helper=1.0, axes_helper_colors=[16711680, 65280, 255], camera_mode='trackball', snapshot_type='full', auto_rendering=True, camera_no_zoom=False, camera_no_rotate=False, camera_no_pan=False, camera_rotate_speed=1.0, camera_zoom_speed=1.2, camera_pan_speed=0.3, camera_damping_factor=0.0, fps=25.0, fps_meter=False, name=None, custom_data=None)[source]#

Create a Plot widget.

Parameters
  • height (int, optional) – Height of the widget in pixels, by default 512.

  • antialias (int, optional) – WebGL renderer antialiasing, by default 3.

  • logarithmic_depth_buffer (bool, optional) – WebGL renderer logarithmic depth buffer, by default True.

  • background_color (int, optional) – Hex color of plot background, by default 0xffffff.

  • camera_auto_fit (bool, optional) – Automatic camera setting after adding, removing or modifying objects, by default True.

  • grid_auto_fit (bool, optional) – Automatic grid adjustment to contained objects, by default True.

  • grid_visible (bool, optional) – Display grid, by default True.

  • screenshot_scale (float, optional) – Screenshot resolution multiplier, by default 2.0.

  • grid (tuple, optional) – 6-element tuple specifying grid bounds (x0, y0, z0, x1, y1, z1), by default (-1, -1, -1, 1, 1, 1).

  • grid_color (int, optional) – Hex color of the grid, by default 0xe6e6e6.

  • label_color (int, optional) – Hex color of labels, by default 0x444444.

  • lighting (float, optional) – Lighting factor, by default 1.5.

  • menu_visibility (bool, optional) – Display K3D panel, by default True.

  • voxel_paint_color (int, optional) – (initial) int value to be inserted when editing voxels, by default 0.

  • colorbar_object_id (int, optional) – Id of colorbar object, by default -1.

  • camera_fov (float, optional) – Camera field of view, by default 60.0.

  • time (float, optional) – Time value, by default 0.0.

  • axes (list, optional) – Axes labels, by default [‘x’, ‘y’, ‘z’].

  • axes_helper (float, optional) – Axes helper size, by default 1.0.

  • name (str, optional) – Object name, by default None.

  • group (str, optional) – Name of a group, by default None.

  • camera_mode ({'trackball', 'orbit', 'fly'}, optional) – Mode of camera, by default ‘trackball’.

  • snapshot_type ({'full', 'online', 'inline'}, optional) – Type of snapshot, by default ‘full’.

  • auto_rendering (bool, optional) – Auto rendering state, by default True.

  • camera_no_zoom (bool, optional) – Lock camera zoom, by default False.

  • camera_no_rotate (bool, optional) – Lock camera rotation, by default False.

  • camera_no_pan (bool, optional) – Lock camera pan, by default False.

  • camera_rotate_speed (float, optional) – Camera rotation speed, by default 1.0.

  • camera_zoom_speed (float, optional) – Camera zoom speed, by default 1.2.

  • camera_pan_speed (float, optional) – Camera pan speed, by default 0.3.

  • camera_damping_factor (float, optional) – Camera intensity of damping, by default 0.0.

  • fps (float, optional) – Animations FPS, by default 25.0.

  • custom_data (dict) – A object with custom data attached to object.

Returns

Plot Widget.

Return type

Plot

Examples#

Coloring#

import k3d

plot = k3d.plot(background_color=0x1e1e1e,
                grid_color=0xd2d2d2,
                label_color=0xf0f0f0)

plot.display()

Axes and bounds#

import k3d

plot = k3d.plot(grid=(0, 0, 0, 60, 20, 50),
                axes=['Time', 'Mass', 'Temperature'])

plot.display()

Static#

import k3d

plot = k3d.plot(camera_no_pan=True,
                camera_no_rotate=True,
                camera_no_zoom=True,
                menu_visibility=False)

plot.display()