You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mac OS X backend: <Error>: CGContextClosePath: no current point #3654
With the Mac OS X backend, under certain conditions, I guess tons of error messages like:
Oct 17 15:47:38 weinberg.local Python[877] <Error>: CGContextClosePath: no current point.
when I move the mouse inside a slider and when the figure is first drawn (it contains many plots). The TkAgg backend does not report any problem.
This slows down considerably the interaction with the slider.
The code is currently complex, so sharing it here is not obvious: are there tests, changes, etc. that I could run so as to try to nail down the problem?
@lebigot Can you check the sequence of codes in _draw_path ? I am wondering if the sequence of codes is incorrect (then the bug is upstream), or the sequence of codes is correct, but _draw_path misinterprets them.
I remember that that the error message was actually printed before I touched the slider: it was printed after displaying a few graphs.
I do have a quadmesh in my code (pcolormesh).
This points to the quadmesh code being the culprit.
@mdehoon I am not sure how to perform the check you mentioned: it would take someone more versed into Matplolib's internals. :) I am currently failing to reproduce the problem, but I am not sure under which exact conditions I had it…
Activity
tacaswell commentedon Oct 17, 2014
what version of mpl?
cc @mdehoon
lebigot commentedon Oct 17, 2014
That's for version 1.4.0.
tacaswell commentedon Oct 17, 2014
The string
CGContextClosePathonly shows up two places in the code, in_draw_pathand in quadmesh drawing. From your comment I am assuming the problem is in the first (https://github.com/matplotlib/matplotlib/blob/master/src/_macosx.m#L265). Thecrobject looks to be one of these things (https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CGContext/index.html). I suspect that there needs to be some sanity checking oncrprior to the call otCGClosePath.I don't have a mac to test any of these theories on....
This looks relevant: http://www.finetunedmac.com/forums/ubbthreads.php?ubb=showflat&Number=26496
mdehoon commentedon Oct 22, 2014
@lebigot Can you check the sequence of codes in _draw_path ? I am wondering if the sequence of codes is incorrect (then the bug is upstream), or the sequence of codes is correct, but _draw_path misinterprets them.
lebigot commentedon Nov 1, 2014
Two points:
This points to the quadmesh code being the culprit.
@mdehoon I am not sure how to perform the check you mentioned: it would take someone more versed into Matplolib's internals. :) I am currently failing to reproduce the problem, but I am not sure under which exact conditions I had it…
mdehoon commentedon Nov 19, 2014
Are you able to replicate the bug?
lebigot commentedon Nov 19, 2014
I tried, but failed to replicate the bug. It happened while running on data that I don't have at hand anymore.
That said, I have seen it many times before in other projects of mine, so next time I'll try to post something more specific if it happens again.
lebigot commentedon Dec 31, 2014
I just found a simple way of replicating the error, that might have been the original way that triggered it:
Granted, it is strange to use
nanhere, but a more instructive warning would be great.mdehoon commentedon Jan 5, 2015
OK I get the same error message with your example.
Can you change line 265 in src/_macosx.m from
to
and make sure the error message doesn't appear? It would be great if you could run the test suite to make sure this doesn't introduce new bugs.
lebigot commentedon Jan 5, 2015
I never compiled Matplotlib (MacPorts!) and I will unfortunately not be able to do this right now…
PS: It's great that you have some idea for the fix. :)
tacaswell commentedon Feb 7, 2015
@mdehoon Can you put in a PR with that patch?
tacaswell commentedon Feb 9, 2015
Closed by #4006