I have old scripts I had made that I was rerunning in newer versions of matplotlib. They now fail because the function requires dashes to be greater than 0. I have them set to zero as below and it still throws the error. I had to set the zero in the middle to 1e-12 to get around this but is this the desired behavior? I don’t see why 0 can’t be an acceptable input to the dash function. This is on matplotlib 1.3.0rc2.
Example code:
dashes = [(1.5,1.5,3,1.5),(1,0),(1,1.2)]
legendLabels.append(ax.plot(x,y[i], color=plotColor[i%8], dashes=dashes[i%3])[0])
End of error:
/home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/lines.pyc in _draw_lines(self, renderer, gc, path, trans)
936
937 def _draw_lines(self, renderer, gc, path, trans):
–> 938 self._lineFunc(renderer, gc, path, trans)
939
940 def _draw_steps_pre(self, renderer, gc, path, trans):
/home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/lines.pyc in _draw_dashed(self, renderer, gc, path, trans)
981 gc.set_linestyle(‘dashed’)
982 if self._dashSeq is not None:
–> 983 gc.set_dashes(0, self._dashSeq)
984
985 renderer.draw_path(gc, path, trans)
/home/bigtyme/.virtualenvs/ipl/local/lib/python2.7/site-packages/matplotlib-1.3.0rc2-py2.7-linux-x86_64.egg/matplotlib/backend_bases.pyc in set_dashes(self, dash_offset, dash_list)
902 dl = np.asarray(dash_list)
903 if np.any(dl <= 0.0):
–> 904 raise ValueError(“All values in the dash list must be positive”)
905 self._dashes = dash_offset, dash_list
906
ValueError: All values in the dash list must be positive
Cheers,
Jeff