Framerate of Mayavi Quiver Plot lower when Python script executed from Terminal instead of IDE
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
Hello everyone
I have recently started using Mayavi in order to plot some 3D vector data in real time. The data comes from a sensor and is acquired in a seperate Python thread. I am setting the Mayavi pipeline up like this:
```
@mlab.animate(delay=ANIMATION_DELAY_MS)
def make_graph():
while True:
dataX=acquisitionThread.XdataMean
dataY=-1*acquisitionThread.YdataMean
dataZ=acquisitionThread.ZdataMean
obj.mlab_source.u=dataX.flatten()
obj.mlab_source.v=dataY.flatten()
obj.mlab_source.w=dataZ.flatten()
yield
make_graph()
mlab.show()
```
When I run my code from the IDE (Spyder 2.7), the animation is very smooth (~50Hz framrate) and the interaction with the plot is also very smooth.
However, when I run the exact same script from bash under Ubuntu 14.04 via:
`python animationPlot.py`
or by calling the script from a C++ application via:
```
pid_t current_pid;
current_pid=fork();
if(current_pid==0)
system("python animationPlot.py")
```
The framerate is quite low and the interaction with the quiver plot (rotating the coordiante system etc.) also becomes sluggish. I also noticed that the GUI window with the "Start Animation" button looks different when I call the Python script from bash or C. When I run the script from Spyder, the GUI window with the "Start Animation" button appears in the standard GNOME look but when I run the script from bash or C the background and buttons in that GUI window appear dark. (I currently don't have access to the script, I’ll upload a screenshot as soon as possible).
Any ideas what could be the cause of this behaviour and how I could fix this issue?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.