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
y limit with dashed or dotted lines hangs with somewhat big data #1758
When plotting uncontinuous lines and rescaling the y axis to centre the view on some part of the data matplotlib hangs in the show() function forcing me to kill the process.
This does work perfectly with a continuous line or when the data is smaller and uncontinuous lines.
I use matplotlib 1.2.0 on OSX 10.7.5 and I have Python 2.7.3 installed as a famework (with homebrew).
I've seen this before with Quartz. I believe the problem is that when CGContextSetLineDash is set the underlying stroke creates many individual lines in the rendering. So, on a very long line, Quartz takes forever to draw the enormous amount of lines created from the dash pattern.
In this case with the exponential data set and the limits set as so, the lines in terms of pixels are insanely big and I bet the time for Quartz to finish would be something completely absurd.
This suggests that we are trying to draw the full line instead of just the section that will be visible in the window. Perhaps the calling function (_ draw_dashed in matplotlib/lines.py, called as part of the draw method of Line2D) should only draw the section of the line that will be visible, rather than the whole thing? Currently it seems to rely on clipping in order to show the visible section only.
Activity
pelson commentedon Feb 18, 2013
Thanks @fmder.
Can you let us know which backend your using?:
Cheers,
fmder commentedon Feb 18, 2013
tacaswell commentedon Jan 20, 2014
@fmder Is this still a problem on newer version of mpl? (I don't have a mac set up to test this)
mdboom commentedon Jan 21, 2014
I can still reproduce this with today's
master. I suspect this is due to some strange limitation of the Quartz rendering library.@mdehoon: Any thoughts?
cimarronm commentedon Feb 2, 2014
I've seen this before with Quartz. I believe the problem is that when
CGContextSetLineDashis set the underlying stroke creates many individual lines in the rendering. So, on a very long line, Quartz takes forever to draw the enormous amount of lines created from the dash pattern.In this case with the exponential data set and the limits set as so, the lines in terms of pixels are insanely big and I bet the time for Quartz to finish would be something completely absurd.
mdehoon commentedon Feb 3, 2014
It's indeed CGContextStrokePath that is taking forever to finish.
The arguments that renderer.draw_path receives are:
path = Path([[ 0.00000000e+00 1.00000000e+00]
[ 1.00000000e+00 2.00000000e+00]
[ 2.00000000e+00 4.00000000e+00]
[ 3.00000000e+00 8.00000000e+00]
[ 4.00000000e+00 1.60000000e+01]
...
[ 4.60000000e+01 7.03687442e+13]
[ 4.70000000e+01 1.40737488e+14]
[ 4.80000000e+01 2.81474977e+14]
[ 4.90000000e+01 5.62949953e+14]], None)
transform = Affine2D(array([[ 9.92, 0. , 80. ],
[ 0. , 3.84, 48. ],
[ 0. , 0. , 1. ]]))
This suggests that we are trying to draw the full line instead of just the section that will be visible in the window. Perhaps the calling function (_ draw_dashed in matplotlib/lines.py, called as part of the draw method of Line2D) should only draw the section of the line that will be visible, rather than the whole thing? Currently it seems to rely on clipping in order to show the visible section only.
efiring commentedon May 22, 2016
Closed by #6178.