Closed
Description
The following program triggers an Python error and a segmentation fault (notice that the correct linestyle is -.
):
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
plt.hist([0, 1, 1, 2], linestyle='.-')
plt.show()
plot
sanitizes the input, so this just produces a ValueError.
import matplotlib.pyplot as plt
plt.plot([0, 1], [1, 2], linestyle='.-')
The backends Qt4Agg and TkAgg also raise an error, but don't produce a hard crash.
My system is Python 3.5 on a virtual environment with matplotlib built from source via pip.
Full traceback for the aborting snippet:
Traceback (most recent call last):
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 176, in __draw_idle_agg
FigureCanvasAgg.draw(self)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py", line 474, in draw
self.figure.draw(self.renderer)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/figure.py", line 1159, in draw
func(*args)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 2324, in draw
a.draw(renderer)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/patches.py", line 494, in draw
gc.set_linestyle(self._linestyle)
File "/home/david/.virtualenv/py35/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 1064, in set_linestyle
raise ValueError('Unrecognized linestyle: %s' % str(style))
ValueError: Unrecognized linestyle: .-
Aborted (core dumped)
Metadata
Metadata
Assignees
Labels
No labels