Open VijayN10 opened 1 year ago
After downgrading to Matplotlib version 3.5.1, the problem has been resolved.
But is there any other way? Please let me know. Thank you..
This has been changed in matplotlib version 3.6.0 and needs a corresponding fix/PR.
Upstream change: https://github.com/matplotlib/matplotlib/pull/21050
@FriedrichFroebel Is there any workaround for this?
I have not tested this, but replacing https://github.com/nschloe/tikzplotlib/blob/450712b4014799ec5f151f234df84335c90f4b9d/src/tikzplotlib/_path.py#L472-L473 with
dashOffset, dashSeq = line._unscaled_dash_pattern
might work given https://github.com/matplotlib/matplotlib/pull/21050/files#diff-be677869a88f58790f2387fb2ac0ae12e2e9610d7c7096e25d3087d5ed9645c8L1133-R1121
Solution presented by @FriedrichFroebel works just fine, I've just tested it successfully.
Thanks @FriedrichFroebel , its working for me as well! I hope it will be incorporated in next release. I am closing this issue now.
@VijayN10 I do not think that it really makes sense to close this issue while there is no upstream solution for it. For now, there is no corresponding PR to ensure that once this library is finally receiving some more maintenance again this will have an official fix.
@nschloe , @FriedrichFroebel - Okay. Thanks.
Since it is next to impossible to install matplotlib <=3.6, the tikzplotlib package is useless. It would only be fair to remove it from the package list on PyPI.
I do not consider it impossible to install matplotlib<3.6.0
- at least a rather basic Ubuntu 22.04 installation (still supported until 2027) does not seem to have any issues with it. Issues might arise with further libraries requiring more recent matplotlib versions, but matplotlib core functionality should (in theory) not really be affected at all if your own code is compatible enough. (I do not like the tikzplotlib situation either, but I hate reading false claims.) For the same reason, removing the package from PyPI is even more uncommon/worse as it breaks tikzplotlib for everyone and there surely are tons of PyPI packages which have been unmaintained for sometimes more than 10 years.
I tried to install matplotlib
3.5
on my Windows system with python.org
distribution. After overcoming several hurdles and losing several hours, I finally failed. Well, now I have gone back to exporting PDFs and loading them into Latex files.
I started using tikzplotlib
about two years ago and regret that decision because of all the extra problems. I am not an expert on Python packages and perhaps they should all continue to be available, but it would be fair if potential users were warned of the pitfalls that can occur when using tikzplotlib
.
I was unable to save the plot as a TikZ file after upgrading to latest version of matplotlib. It was giving an error of
AttributeError: 'Line2D' object has no attribute '_us_dashSeq'
For plotting, I was using the following code. The error was identified with line style and markevery function.