Skip to content
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

solves Line2D attribute error with matplotlib 3.7.0 #571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomasgillis
Copy link

the error on most recent matplotlib version is the following:

AttributeError: 'Line2D' object has no attribute '_us_dashSeq'

the error on most recent matplotlib version is the following:
```bash
AttributeError: 'Line2D' object has no attribute '_us_dashSeq'
```
@mgorny
Copy link

mgorny commented Apr 21, 2023

@nschloe, ping. Is tikzplotlib still maintained? I'd like to know whether there's a point waiting for new matplotlib support or if we should remove tikzplotlib from Gentoo.

@nschloe
Copy link
Owner

nschloe commented Apr 21, 2023

@mgorny I haven't had much time for tpl indeed. Not exactly sure when I'll be able to again. If it's a blocker for you, best remove it, and add it again when I get back to it.

Comment on lines +472 to +473
dashOffset = line._dash_pattern[0]
dashSeq = line._dash_pattern[1]
Copy link

@st-- st-- May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in https://github.com/nschloe/tikzplotlib/pull/558/files, it would be better to keep this backwards-compatible:

Suggested change
dashOffset = line._dash_pattern[0]
dashSeq = line._dash_pattern[1]
try:
dashOffset, dashSeq = line._dash_pattern[:2]
except AttributeError:
# backwards-compatibility with matplotlib < 3.7.0
dashOffset = line._us_dashOffset
dashSeq = line._us_dashSeq

st-- added a commit to st--/tikzplotlib that referenced this pull request May 6, 2023
…schloe#571]

* solves attribute error with matplotlib `3.7.0`

the error on most recent matplotlib version is the following:
```bash
AttributeError: 'Line2D' object has no attribute '_us_dashSeq'
```

* Update src/tikzplotlib/_path.py

---------

Co-authored-by: Thomas Gillis <25429825+thomasgillis@users.noreply.github.com>
Repository owner deleted a comment from st-- May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants