Comments (2)
You haven't used pyvistaqt
at all to do this plotting but rather pyvista
. So this is either a pyvista bug or -- I would probably argue -- a usage bug where if you want to use pyvista + Qt you should use pyvistaqt.BackgroundPlotter
not pyvista.Plotter
. Can you try incorporating BackgroundPlotter and adding your sphere to it instead of using pv.Sphere.plot()
(which will create a pyvista.Plotter
)?
from pyvistaqt.
I have managed to incorporate BackgroundPlotter
like it is shown below.
Although, does it mean that the pyvista
+ Qt
support is dropped?
import sys
import pyvista as pv
import pyvistaqt as pvqt
import numpy as np
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("My App")
self.button1 = QPushButton("Press Me!")
# Set the central widget of the Window.
self.setCentralWidget(self.button1)
self.button1.clicked.connect(self.show_pvqt)
def show_pvqt(self):
plotter = self.plotter = pvqt.BackgroundPlotter()
sphere = pv.Sphere()
# Create a plotter window
self.mesh = plotter.add_mesh(sphere, show_edges=True, name='sphere')
# Customize the color map
plotter.add_scalar_bar(title="Color Map")
plotter.add_callback(self.change_color, 100)
# Display the plotter window
plotter.show()
x = 0
return 1
def change_color(self):
self.plotter.remove_actor('sphere')
sphere = pv.Sphere()
colors = np.random.rand(sphere.n_points, 3)
self.mesh = self.plotter.add_mesh(sphere, scalars=colors, show_edges=True, name='sphere')
self.plotter.update()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()
from pyvistaqt.
Related Issues (20)
- Race condition: BackgroundPlotter has no attribute named image HOT 3
- Running pyvistaqt project in Github Action HOT 2
- Inconsistent plotting results with PyVistaQT versus Jupyter (Trame) backends HOT 3
- Issue using pyvistaqt QtInteractor on Windows 10
- MAINT: Deploy docs HOT 7
- solicitud para agregar característica, para guardar los modelos en formato obj
- Stage release for PyVista 0.40 HOT 3
- Update GC testing fixture
- MAINT: Remove Azure
- Make the canvas background transparent HOT 1
- X Error of failed request: BadWindow (invalid Window parameter) HOT 3
- Border glitch during resize HOT 6
- macOS `pvqt.BackgroundPlotter` never opens window HOT 2
- DOC: MultiPlotter vs BackgroundPlotter
- no mouse interactivity with BackgroundPlotter HOT 1
- Consider adding `.git_archival.txt` to include version number in git archive
- QtInteractor CPU usage is based on window size and meshes rendered HOT 1
- circular import
- Not compatible with PySide 6.7 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvistaqt.