Conversation
|
Updated in main repository. |
examples/misc/multiprocess.py
Outdated
| pl.plot() | ||
| time.sleep(0.5) | ||
| raw_input('press Enter...') | ||
| # input('press Enter...') #Python3 |
There was a problem hiding this comment.
Let's just make it conditional on sys.version_info?
There was a problem hiding this comment.
We could also remove both lines, actually they do not add anything to this example.
|
In my version, which I derived from this example, I am using set_xdata and set_ydata to update the plot. Replotting becomes very slow because of the growing self.x and self.y array, but I guess that would be a new example. |
examples/misc/multiprocess.py
Outdated
|
|
||
| import matplotlib | ||
| matplotlib.use('GtkAgg') | ||
| matplotlib.use('TkAgg') |
There was a problem hiding this comment.
Since you're using canvas API now, this might be portable enough to not require setting a specific backend at all.
|
Wasn't sure if I needed the set a backend. Removed the line. |
|
@Thomas00010111 I tested it on OSX, It seems like not all the backends are fork safe on OSX I suggest adding a comment about this along with a commented out backend selection. In my experience the qt backends work the best, i.e. add something like/ where you removed the other backend selection |
|
Thanks for testing on OSX. In my case I need to use matplotlib.use('QT4Agg'). |
|
Some more investigation reveals that the best solution to get this working reliably on OSX is to use a |
|
Pasted your lines into the code. Uncommenting the lines gives an error message in my case. I am running Ubuntu 14.04 and Python 3.4. It seems that the forkserver is already the default. Traceback (most recent call last): |
|
The code setting the forkserver needs to be in the |
|
Ah, ok. Changed the code and the program works now. |
examples/misc/multiprocess.py
Outdated
| return True | ||
|
|
||
| return call_back | ||
| self.fig.canvas.draw() |
There was a problem hiding this comment.
It is better to use draw_idle which defers the actually drawing until the GUI decides to really repaint the screen.
|
There is some trailing whitespace in this file that the pep8 checker is catching. |
|
Changed to draw_idle() and found the white space. |
|
It seems I found a difference between draw_idle() and draw(). In my project I cannot use draw_idle(). I have a process (a quadcopter simulator) which generates data, this data should be shown in the graph, realtime would be nice but if the graphs lags behind a bit is not a problem. When I use draw_idle() the graph gets update at once when the simulation process is finished. So I cannot see the quadcopter moving. |
|
that shouldn't happen, something else must be wrong to cause behavior like Which backend are you using that you are seeing this behavior? On Thu, Jun 30, 2016 at 6:49 PM, Thomas00010111 notifications@github.com
|
|
For All of the backends should have a I have started to write this stuff up in #4779 |
Removed dependency to gobject (could not install/import package)
added () to return call_back