Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Update multiprocess.py#6637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thomas00010111 commentedJun 23, 2016
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Let's just make it conditional onsys.version_info?
Thomas00010111Jun 23, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We could also remove both lines, actually they do not add anything to this example.
Thomas00010111 commentedJun 23, 2016
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
| importmatplotlib | ||
| matplotlib.use('GtkAgg') | ||
| matplotlib.use('TkAgg') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Since you're using canvas API now, this might be portable enough to not require setting a specific backend at all.
Thomas00010111 commentedJun 24, 2016
Wasn't sure if I needed the set a backend. Removed the line. |
jenshnielsen commentedJun 25, 2016
@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 |
Thomas00010111 commentedJun 25, 2016
Thanks for testing on OSX. In my case I need to use matplotlib.use('QT4Agg'). |
jenshnielsen commentedJun 26, 2016
Some more investigation reveals that the best solution to get this working reliably on OSX is to use a |
Thomas00010111 commentedJun 26, 2016
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): |
jenshnielsen commentedJun 27, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The code setting the forkserver needs to be in the |
Thomas00010111 commentedJun 27, 2016
Ah, ok. Changed the code and the program works now. |
examples/misc/multiprocess.py Outdated
| returnTrue | ||
| returncall_back | ||
| self.fig.canvas.draw() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is better to usedraw_idle which defers the actually drawing until the GUI decides to really repaint the screen.
tacaswell commentedJun 29, 2016
There is some trailing whitespace in this file that the pep8 checker is catching. |
Thomas00010111 commentedJun 30, 2016
Changed to draw_idle() and found the white space. |
Thomas00010111 commentedJun 30, 2016
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. |
WeatherGod commentedJul 1, 2016
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, Thomas00010111notifications@github.com
|
tacaswell commentedJul 1, 2016
For All of the backends should have a I have started to write this stuff up in#4779 |
anntzer commentedJan 5, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Removed dependency to gobject (could not install/import package)
added () to return call_back