Tiago,
I am using Ubuntu 16.04 (on a fresh install) and the way I plot the graph is using a GraphWidget that is attached to a Glade-generated GUI. The error I get is a segmentation fault that kills the whole python environment, which leads me to believe that there is something going on with the rendering library - you can see the code dies in the middle of rendering. Note that this happens on v2.22 and v2.23 but NOT on v.2.19.
I know I am not being much more specific than before, but posting the code that currently crashes would be of zero help since it far from the simple example that you are asking.
I was hoping that somebody else on the forum might have observed similar behavior. If not I will spend some time trying to create a simple and self-contained example that captures this behavior.
Regards,
Vaggelis