Skip to content

backend_svg fails with dashed line style #17290

@nschloe

Description

@nschloe

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'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy