I have an interface that I am writing using tkinter. Inside that interface, I have a matplotlib plot. In the background, I have zmq connecting to a server to get data. I am using python's multiprocessing module with a Queue sharing data and a Process running for all of the zmq communication.
In the GUI, I can set up a button to update the plot with the following function:
def addData(self):
if not self.data.empty():
print "Have Data!"
self.hist.addQueue(self.data)
self.hist.updatePlot()
else:
print "No Data"
However, if I try to create another process that basically puts this inside of a while True
, I get the following error:
X Error of failed request: RenderBadPicture (invalid Picture parameter)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 7 (RenderFreePicture)
Picture id in failed request: 0x160000a
Serial number of failed request: 2686
Current serial number in output stream: 2690
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
fish: Job 1, “python clientGUI.py ” terminated by signal SIGABRT (Abort)
I can't find anything about this error that seems to be related to anything that I'm doing.
I can provide other parts of my code if needed, but there's a good bit of code that I didn't want to floood the question with.