Skip to content

backend_svg fails with dashed line style #17290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nschloe opened this issue May 1, 2020 · 1 comment
Closed

backend_svg fails with dashed line style #17290

nschloe opened this issue May 1, 2020 · 1 comment
Milestone

Comments

@nschloe
Copy link
Contributor

nschloe commented May 1, 2020

When using a dashed line style, the SVG backend fails. MWE:

import matplotlib.pyplot as plt

plt.style.use({"axes.grid": True, "grid.linestyle": (10, 10)})

x = [1, 2, 3]
y = [1, 2, 3]
plt.plot(x, y)
# plt.show()  # works fine
plt.savefig("out.svg")
[...]
  File "~/.local/lib/python3.8/site-packages/matplotlib/backends/backend_svg.py", line 435, in _get_style_dict
    attrib['stroke-dashoffset'] = short_float_fmt(float(offset))
TypeError: float() argument must be a string or a number, not 'NoneType'
@anntzer
Copy link
Contributor

anntzer commented May 1, 2020

This was fixed in master by #15828 (which will be in 3.3).

@anntzer anntzer closed this as completed May 1, 2020
@QuLogic QuLogic added this to the v3.3.0 milestone May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants