Skip to main content
`Ctrl`+`K`

# vispy package

## Subpackages

- vispy.app package
  - Subpackages
    - vispy.app.backends package
      - Subpackages
      - Module contents
    - vispy.app.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.app.application module
      - `Application`
    - vispy.app.base module
      - `BaseApplicationBackend`
      - `BaseCanvasBackend`
      - `BaseTimerBackend`
    - vispy.app.canvas module
      - `Canvas`
      - `DrawEvent`
      - `KeyEvent`
      - `MouseEvent`
      - `ResizeEvent`
    - vispy.app.qt module
      - `QtCanvas`
      - `QtSceneCanvas`
    - vispy.app.timer module
      - `Timer`
  - Module contents
- vispy.color package
  - Subpackages
    - vispy.color.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.color.color_array module
      - `Color`
      - `ColorArray`
    - vispy.color.color_space module
    - vispy.color.colormap module
      - `BaseColormap`
      - `Colormap`
      - `CubeHelixColormap`
      - `Diverging`
      - `HSL`
      - `HSLuv`
      - `MatplotlibColormap`
      - `RedYellowBlueCyan`
      - `SingleHue`
      - `get_colormap()`
      - `get_colormaps()`
      - `mix()`
      - `smoothstep()`
      - `step()`
  - Module contents
    - `BaseColormap`
      - `BaseColormap.bad_color`
      - `BaseColormap.colors`
      - `BaseColormap.glsl_map`
      - `BaseColormap.high_color`
      - `BaseColormap.low_color`
      - `BaseColormap.map()`
      - `BaseColormap.texture_lut()`
      - `BaseColormap.texture_map_data`
    - `Color`
      - `Color.RGB`
      - `Color.RGBA`
      - `Color.alpha`
      - `Color.hex`
      - `Color.hsv`
      - `Color.is_blank`
      - `Color.lab`
      - `Color.rgb`
      - `Color.rgba`
      - `Color.value`
    - `ColorArray`
      - `ColorArray.RGB`
      - `ColorArray.RGBA`
      - `ColorArray.alpha`
      - `ColorArray.copy()`
      - `ColorArray.darker()`
      - `ColorArray.extend()`
      - `ColorArray.hex`
      - `ColorArray.hsv`
      - `ColorArray.lab`
      - `ColorArray.lighter()`
      - `ColorArray.rgb`
      - `ColorArray.rgba`
      - `ColorArray.value`
    - `Colormap`
      - `Colormap.interpolation`
      - `Colormap.map()`
      - `Colormap.texture_lut()`
    - `get_color_dict()`
    - `get_color_names()`
    - `get_colormap()`
    - `get_colormaps()`
- vispy.geometry package
  - Subpackages
    - vispy.geometry.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.geometry.calculations module
      - `resize()`
    - vispy.geometry.curves module
      - `calc_sq_distance()`
      - `curve3_bezier()`
      - `curve4_bezier()`
    - vispy.geometry.generation module
      - `create_arrow()`
      - `create_box()`
      - `create_cone()`
      - `create_cube()`
      - `create_cylinder()`
      - `create_grid_mesh()`
      - `create_plane()`
      - `create_sphere()`
    - vispy.geometry.isocurve module
      - `isocurve()`
    - vispy.geometry.isosurface module
      - `isosurface()`
    - vispy.geometry.meshdata module
      - `MeshData`
    - vispy.geometry.normals module
      - `compact()`
      - `normals()`
    - vispy.geometry.parametric module
      - `surface()`
    - vispy.geometry.polygon module
      - `PolygonData`
    - vispy.geometry.rect module
      - `Rect`
    - vispy.geometry.torusknot module
      - `TorusKnot`
    - vispy.geometry.triangulation module
      - `Triangulation`
      - `triangulate()`
  - Module contents
    - `MeshData`
      - `MeshData.get_bounds()`
      - `MeshData.get_edge_colors()`
      - `MeshData.get_edges()`
      - `MeshData.get_face_colors()`
      - `MeshData.get_face_normals()`
      - `MeshData.get_faces()`
      - `MeshData.get_vertex_colors()`
      - `MeshData.get_vertex_faces()`
      - `MeshData.get_vertex_normals()`
      - `MeshData.get_vertex_values()`
      - `MeshData.get_vertices()`
      - `MeshData.has_edge_indexed_data()`
      - `MeshData.has_face_color()`
      - `MeshData.has_face_indexed_data()`
      - `MeshData.has_vertex_color()`
      - `MeshData.has_vertex_value()`
      - `MeshData.is_empty()`
      - `MeshData.n_faces`
      - `MeshData.n_vertices`
      - `MeshData.reset_normals()`
      - `MeshData.restore()`
      - `MeshData.save()`
      - `MeshData.set_face_colors()`
      - `MeshData.set_faces()`
      - `MeshData.set_vertex_colors()`
      - `MeshData.set_vertex_values()`
      - `MeshData.set_vertices()`
    - `PolygonData`
      - `PolygonData.add_vertex()`
      - `PolygonData.convex_hull`
      - `PolygonData.edges`
      - `PolygonData.faces`
      - `PolygonData.triangulate()`
      - `PolygonData.vertices`
    - `Rect`
      - `Rect.bottom`
      - `Rect.center`
      - `Rect.contains()`
      - `Rect.flipped()`
      - `Rect.height`
      - `Rect.left`
      - `Rect.normalized()`
      - `Rect.padded()`
      - `Rect.pos`
      - `Rect.right`
      - `Rect.size`
      - `Rect.top`
      - `Rect.width`
    - `Triangulation`
      - `Triangulation.triangulate()`
    - `create_arrow()`
    - `create_box()`
    - `create_cone()`
    - `create_cube()`
    - `create_cylinder()`
    - `create_grid_mesh()`
    - `create_plane()`
    - `create_sphere()`
    - `resize()`
    - `triangulate()`
- vispy.gloo package
  - Subpackages
    - vispy.gloo.gl package
      - Subpackages
      - Submodules
      - Module contents
    - vispy.gloo.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.gloo.buffer module
      - `Buffer`
      - `DataBuffer`
      - `DataBufferView`
      - `IndexBuffer`
      - `VertexBuffer`
    - vispy.gloo.context module
      - `FakeCanvas`
      - `GLContext`
      - `GLShared`
      - `forget_canvas()`
      - `get_current_canvas()`
      - `get_default_config()`
      - `set_current_canvas()`
    - vispy.gloo.framebuffer module
      - `FrameBuffer`
      - `RenderBuffer`
    - vispy.gloo.glir module
      - GL Intermediate Representation Desktop Implementation
      - `BaseGlirParser`
      - `GlirBuffer`
      - `GlirFragmentShader`
      - `GlirFrameBuffer`
      - `GlirGeometryShader`
      - `GlirIndexBuffer`
      - `GlirObject`
      - `GlirParser`
      - `GlirProgram`
      - `GlirQueue`
      - `GlirRenderBuffer`
      - `GlirShader`
      - `GlirTexture`
      - `GlirTexture1D`
      - `GlirTexture2D`
      - `GlirTexture3D`
      - `GlirTextureCube`
      - `GlirVertexBuffer`
      - `GlirVertexShader`
      - `as_enum()`
      - `as_es2_command()`
      - `convert_shader()`
      - `glTexImage1D()`
      - `glTexImage3D()`
      - `glTexSubImage1D()`
      - `glTexSubImage3D()`
      - `glir_logger()`
    - vispy.gloo.globject module
      - On queues
      - `GLObject`
    - vispy.gloo.preprocessor module
      - `merge_includes()`
      - `preprocess()`
      - `remove_comments()`
    - vispy.gloo.program module
      - Gloo vs GLIR
      - `FragmentShader`
      - `GeometryShader`
      - `Program`
      - `Shader`
      - `VertexShader`
    - vispy.gloo.texture module
      - `BaseTexture`
      - `Texture1D`
      - `Texture2D`
      - `Texture3D`
      - `TextureAtlas`
      - `TextureCube`
      - `TextureEmulated3D`
      - `convert_dtype_and_clip()`
      - `downcast_to_32bit_if_needed()`
      - `get_dtype_limits()`
    - vispy.gloo.util module
      - `check_enum()`
      - `check_identifier()`
      - `check_variable()`
      - `draw_texture()`
    - vispy.gloo.wrappers module
      - `GL_PRESETS`
      - `GlooFunctions`
      - `clear()`
      - `finish()`
      - `flush()`
      - `get_gl_configuration()`
      - `get_state_presets()`
      - `read_pixels()`
      - `set_blend_color()`
      - `set_blend_equation()`
      - `set_blend_func()`
      - `set_clear_color()`
      - `set_clear_depth()`
      - `set_clear_stencil()`
      - `set_color_mask()`
      - `set_cull_face()`
      - `set_depth_func()`
      - `set_depth_mask()`
      - `set_depth_range()`
      - `set_front_face()`
      - `set_hint()`
      - `set_line_width()`
      - `set_polygon_offset()`
      - `set_sample_coverage()`
      - `set_scissor()`
      - `set_state()`
      - `set_stencil_func()`
      - `set_stencil_mask()`
      - `set_stencil_op()`
      - `set_viewport()`
  - Module contents
- vispy.glsl package
  - Submodules
    - vispy.glsl.build_spatial_filters module
      - `Bessel`
      - `Blackman`
      - `CatRom`
      - `Cubic`
      - `Gaussian`
      - `Hamming`
      - `Hanning`
      - `Hermite`
      - `Kaiser`
      - `Lanczos`
      - `Linear`
      - `Mitchell`
      - `Quadric`
      - `Sinc`
      - `SpatialFilter`
      - `Spline16`
      - `Spline36`
      - `generate_filter_code()`
      - `main()`
  - Module contents
    - `find()`
    - `get()`
- vispy.io package
  - Subpackages
    - vispy.io.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.io.datasets module
      - `load_crate()`
      - `load_iris()`
      - `load_spatial_filters()`
      - `pack_ieee()`
      - `pack_unit()`
    - vispy.io.image module
      - `imread()`
      - `imsave()`
      - `read_png()`
      - `write_png()`
    - vispy.io.mesh module
      - `read_mesh()`
      - `write_mesh()`
    - vispy.io.stl module
      - `HeaderError`
      - `load_stl()`
      - `load_stl_ascii()`
      - `load_stl_binary()`
    - vispy.io.wavefront module
      - `WavefrontReader`
      - `WavefrontWriter`
  - Module contents
    - `imread()`
    - `imsave()`
    - `load_crate()`
    - `load_data_file()`
    - `load_iris()`
    - `load_spatial_filters()`
    - `read_mesh()`
    - `read_png()`
    - `write_mesh()`
    - `write_png()`
- vispy.plot package
  - Subpackages
    - vispy.plot.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.plot.fig module
      - `Fig`
    - vispy.plot.plotwidget module
      - `PlotWidget`
  - Module contents
    - Usage
- vispy.scene package
  - Subpackages
    - vispy.scene.cameras package
      - Subpackages
      - Submodules
      - Module contents
    - vispy.scene.tests package
      - Submodules
      - Module contents
    - vispy.scene.widgets package
      - Subpackages
      - Submodules
      - Module contents
  - Submodules
    - vispy.scene.canvas module
      - `SceneCanvas`
    - vispy.scene.events module
      - `SceneMouseEvent`
    - vispy.scene.node module
      - `Node`
    - vispy.scene.subscene module
      - `SubScene`
    - vispy.scene.visuals module
      - `Arrow`
      - `Axis`
      - `Box`
      - `ColorBar`
      - `ComplexImage`
      - `Compound`
      - `Cube`
      - `Ellipse`
      - `Graph`
      - `GridLines`
      - `GridMesh`
      - `Histogram`
      - `Image`
      - `InfiniteLine`
      - `InstancedMesh`
      - `Isocurve`
      - `Isoline`
      - `Isosurface`
      - `Line`
      - `LinePlot`
      - `LinearRegion`
      - `Markers`
      - `Mesh`
      - `MeshNormals`
      - `Plane`
      - `Polygon`
      - `Rectangle`
      - `RegularPolygon`
      - `ScrollingLines`
      - `Spectrogram`
      - `Sphere`
      - `SurfacePlot`
      - `Text`
      - `Tube`
      - `VisualNode`
      - `Volume`
      - `Windbarb`
      - `XYZAxis`
  - Module contents
    - Overview
- vispy.testing package
  - Subpackages
    - vispy.testing.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.testing.image_tester module
    - vispy.testing.rendered_array_tester module
  - Module contents
- vispy.util package
  - Subpackages
    - vispy.util.dpi package
      - Subpackages
      - Module contents
    - vispy.util.fonts package
      - Subpackages
      - Module contents
    - vispy.util.svg package
      - Submodules
      - Module contents
    - vispy.util.tests package
      - Submodules
      - Module contents
  - Submodules
    - vispy.util.bunch module
      - `SimpleBunch`
    - vispy.util.check_environment module
      - `has_backend()`
      - `has_matplotlib()`
      - `has_skimage()`
    - vispy.util.config module
      - `Config`
      - `ConfigEvent`
      - `get_config_keys()`
      - `save_config()`
      - `set_data_dir()`
      - `sys_info()`
    - vispy.util.eq module
      - `eq()`
    - vispy.util.event module
      - `EmitterGroup`
      - `Event`
      - `EventBlocker`
      - `EventEmitter`
      - `WarningEmitter`
    - vispy.util.fetching module
      - `ProgressBar`
      - `load_data_file()`
      - `sizeof_fmt()`
    - vispy.util.filter module
      - `gaussian_filter()`
    - vispy.util.fourier module
      - `fft_freqs()`
      - `stft()`
    - vispy.util.frozen module
      - `Frozen`
    - vispy.util.gallery_scraper module
      - `FrameGrabber`
      - `VisPyGalleryScraper`
      - `get_canvaslike_from_globals()`
    - vispy.util.keys module
      - `Key`
    - vispy.util.logs module
      - `NumPyJSONEncoder`
      - `log_exception()`
      - `set_log_level()`
      - `use_log_level`
    - vispy.util.osmesa_gl module
      - `fix_osmesa_gl_lib()`
    - vispy.util.profiler module
      - `Profiler`
    - vispy.util.ptime module
      - `time()`
    - vispy.util.quaternion module
      - `Quaternion`
    - vispy.util.transforms module
      - `affine_map()`
      - `frustum()`
      - `ortho()`
      - `perspective()`
      - `rotate()`
      - `scale()`
      - `translate()`
    - vispy.util.wrappers module
      - `run_subprocess()`
      - `test()`
      - `use()`
  - Module contents
- vispy.visuals package
  - Subpackages
    - vispy.visuals.collections package
      - Submodules
      - Module contents
    - vispy.visuals.filters package
      - Subpackages
      - Submodules
      - Module contents
    - vispy.visuals.glsl package
      - Submodules
      - Module contents
    - vispy.visuals.graphs package
      - Subpackages
      - Submodules
      - Module contents
    - vispy.visuals.line package
      - Submodules
      - Module contents
    - vispy.visuals.shaders package
      - Subpackages
      - Submodules
      - Module contents
    - vispy.visuals.tests package
      - Submodules
      - Module contents
    - vispy.visuals.text package
      - Submodules
      - Module contents
    - vispy.visuals.transforms package
      - Subpackages
      - Submodules
      - Module contents
  - Submodules
    - vispy.visuals.axis module
      - `AxisVisual`
      - `MaxNLocator`
      - `Ticker`
      - `scale_range()`
    - vispy.visuals.border module
    - vispy.visuals.box module
      - `BoxVisual`
    - vispy.visuals.colorbar module
      - `ColorBarVisual`
    - vispy.visuals.conftest module
    - vispy.visuals.cube module
      - `CubeVisual`
    - vispy.visuals.ellipse module
      - `EllipseVisual`
    - vispy.visuals.gridlines module
      - `GridLinesVisual`
    - vispy.visuals.gridmesh module
      - `GridMeshVisual`
    - vispy.visuals.histogram module
      - `HistogramVisual`
    - vispy.visuals.image module
      - `ImageVisual`
    - vispy.visuals.image_complex module
      - `ComplexImageVisual`
    - vispy.visuals.infinite_line module
      - `InfiniteLineVisual`
    - vispy.visuals.instanced_mesh module
      - `InstancedMeshVisual`
    - vispy.visuals.isocurve module
      - `IsocurveVisual`
    - vispy.visuals.isoline module
      - `IsolineVisual`
      - `iso_mesh_line()`
    - vispy.visuals.isosurface module
      - `IsosurfaceVisual`
    - vispy.visuals.line_plot module
      - `LinePlotVisual`
    - vispy.visuals.linear_region module
      - `LinearRegionVisual`
    - vispy.visuals.markers module
      - `MarkersVisual`
    - vispy.visuals.mesh module
      - `MeshVisual`
    - vispy.visuals.mesh_normals module
      - `MeshNormalsVisual`
    - vispy.visuals.plane module
      - `PlaneVisual`
    - vispy.visuals.polygon module
      - `PolygonVisual`
    - vispy.visuals.rectangle module
      - `RectangleVisual`
    - vispy.visuals.regular_polygon module
      - `RegularPolygonVisual`
    - vispy.visuals.scrolling_lines module
      - `ScrollingLinesVisual`
    - vispy.visuals.spectrogram module
      - `SpectrogramVisual`
    - vispy.visuals.sphere module
      - `SphereVisual`
    - vispy.visuals.surface_plot module
      - `SurfacePlotVisual`
    - vispy.visuals.tube module
      - `TubeVisual`
    - vispy.visuals.visual module
      - Definitions
      - Class Structure
      - Making Visual Subclasses
      - Making CompoundVisual Subclasses
      - `BaseVisual`
      - `BaseVisualView`
      - `CompoundVisual`
      - `CompoundVisualView`
      - `Visual`
      - `VisualShare`
      - `VisualView`
      - `updating_property`
    - vispy.visuals.volume module
      - About this technique
      - `VolumeVisual`
    - vispy.visuals.windbarb module
      - `WindbarbVisual`
    - vispy.visuals.xyz_axis module
      - `XYZAxisVisual`
  - Module contents

## Submodules

- vispy.conftest module
  - `pytest_configure()`
- vispy.version module

## Module contents

Vispy is a high-performance interactive 2D/3D data visualization library. Vispy leverages the computational power of modern Graphics Processing Units (GPUs) through the OpenGL library to display very large datasets.

For more information, see http://vispy.org.

vispy.set_log_level(verbose, match=None, return_old=False)

  Convenience function for setting the logging level

  Parameters:
    verbose bool, str, int, or None

      The verbosity of messages to print. If a str, it can be either DEBUG, INFO, WARNING, ERROR, or CRITICAL. Note that these are for convenience and are equivalent to passing in logging.DEBUG, etc. For bool, True is the same as ‘INFO’, False is the same as ‘WARNING’.

    match str | None

      String to match. Only those messages that both contain a substring that regexp matches `'match'` (and the `verbose` level) will be displayed.

    return_old bool

      If True, return the old verbosity level and old match.

  See also

  `vispy.util.use_log_level`

  Notes

  If `verbose=='debug'`, then the `vispy` method emitting the log message will be prepended to each log message, which is useful for debugging. If `verbose=='debug'` or `match is not None`, then a small performance overhead is added. Thus it is suggested to only use these options when performance is not crucial.

vispy.sys_info(fname=None, overwrite=False)

  Get relevant system and debugging information

  Parameters:
    fname str | None

      Filename to dump info to. Use None to simply print.

    overwrite bool

      If True, overwrite file (if it exists).

  Returns:
    out str

      The system information as a string.

vispy.test(*args, **kwargs)

  Proxy function to delay .testing import

vispy.use(app=None, gl=None)

  Set the usage options for vispy

  Specify what app backend and GL backend to use.

  Parameters:
    app str
      The app backend to use (case insensitive). Standard backends:

        - ‘PyQt4’: use Qt widget toolkit via PyQt4.

        - ‘PyQt5’: use Qt widget toolkit via PyQt5.

        - ‘PyQt6’: use Qt widget toolkit via PyQt6.

        - ‘PySide’: use Qt widget toolkit via PySide.

        - ‘PySide2’: use Qt widget toolkit via PySide2.

        - ‘PySide6’: use Qt widget toolkit via PySide6.

        - ‘PyGlet’: use Pyglet backend.

        - ‘Glfw’: use Glfw backend (successor of Glut). Widely available on Linux.

        - ‘SDL2’: use SDL v2 backend.

        - ‘osmesa’: Use OSMesa backend

      Additional backends:

        - ‘jupyter_rfb’: show vispy canvases in Jupyter lab/notebook (depends on the jupyter_rfb library).

    gl str
      The gl backend to use (case insensitive). Options are:

        - ‘gl2’: use Vispy’s desktop OpenGL API.

        - ‘pyopengl2’: use PyOpenGL’s desktop OpenGL API. Mostly for testing.

        - ‘es2’: (TO COME) use real OpenGL ES 2.0 on Windows via Angle. Availability of ES 2.0 is larger for Windows, since it relies on DirectX.

        - ‘gl+’: use the full OpenGL functionality available on your system (via PyOpenGL).

  See also

  `vispy.app.use_app`
  `vispy.gloo.gl.use_gl`

  Notes

  If the app option is given, `vispy.app.use_app()` is called. If the gl option is given, `vispy.gloo.use_gl()` is called.

  If an app backend name is provided, and that backend could not be loaded, an error is raised.

  If no backend name is provided, Vispy will first check if the GUI toolkit corresponding to each backend is already imported, and try that backend first. If this is unsuccessful, it will try the ‘default_backend’ provided in the vispy config. If still not succesful, it will try each backend in a predetermined order.