Vispy Python Graphics: Difference between revisions
From wikiluntti
(→1) |
|||
Line 26: | Line 26: | ||
== Simple programs == | == Simple programs == | ||
=== | === Dots === | ||
Uniocode generator https://lingojam.com/SuperscriptGenerator | |||
<syntaxhighlight lang="python"> | |||
import vispy.plot as vp | |||
fig = vp.Fig(size=(600, 500), show=False) | |||
plotwidget = fig[0, 0] | |||
fig.title = "Line Plot" | |||
plotwidget.plot([(x, x**2) for x in range(0, 100)], title="y = x²") | |||
plotwidget.colorbar(position="top", cmap="spring") | |||
fig.show(run=True) | |||
</syntaxhighlight > | |||
=== 2 === | === 2 === |
Revision as of 13:15, 14 April 2025
Introduction
VIspy; Python; 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.
Installation
Install using many methods: here is pip. Include PyQT5.
Also you can also install VisPy from Test PyPI, a separate instance of the Python Package Index that allows you to try distribution tools and processes without affecting the real index.
pip install vispy
pip install PyQt5
pip install --index-url <https://test.pypi.org/simple/> vispy
Test and check the GL version using test() command.
import vispy
vispy.test()
Simple programs
Dots
Uniocode generator https://lingojam.com/SuperscriptGenerator
import vispy.plot as vp
fig = vp.Fig(size=(600, 500), show=False)
plotwidget = fig[0, 0]
fig.title = "Line Plot"
plotwidget.plot([(x, x**2) for x in range(0, 100)], title="y = x²")
plotwidget.colorbar(position="top", cmap="spring")
fig.show(run=True)