'Python script using oct2py to call octave functions that generate plots behaves strangely
I have a Python script that runs with a gui to collect ADC samples from the JTAG port of an FPGA. It writes the data to a csv file. I added some code now that uses Oct2py to open the file via existing Octave functions that plot the time domain data, and also invoke other functions to perform an FFT on the data and plot the spectrum.
For some reason, the time domain fails to display on the first data capture of a given session. However, if I then recollect data, the time domain plot shows up (same Octave session). Even when it doesn't show up, I know it "occurred" because the figure number of the FFT plot incremented to the next figure. I can't figure out why the plot fails to display on the first "go around". Is there an equivalent of plt.show() the I should be invoking with oct2py?
Sometimes, it also feels like the Octave process doesn't release back to the script after the functions are done executing. If I octave.exit(), I lose the plots, so that is not it. Is there a way to "return" to the script? Do I need to explicitly do something I may not be doing to release control back to the python script --or should this happen automatically once the invoked function has finished running?
I can't figure out how to share some of this at this time without creating a separate project to recreate it in a way that behaves the same way and would enable me to share it. So, if you can share any insight as to what may be happening, I appreciate the help. If the code is essential, then let me know, and I will figure out how to share it....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
