Skip to content

Fixed issues with previous pull request#49

Merged
ErwindeGelder merged 25 commits intoErwindeGelder:mainfrom
AlexChrzanowski:main
Feb 4, 2026
Merged

Fixed issues with previous pull request#49
ErwindeGelder merged 25 commits intoErwindeGelder:mainfrom
AlexChrzanowski:main

Conversation

@AlexChrzanowski
Copy link
Copy Markdown
Contributor

I went back and fixed the issue that made all of the tests fail before. I've run it independently and all of the tests seem to work. I also added two tests of my own and their associated reference files.

"test_multi_line_title" tests for a correctly implemented new line in titles with '\n'. If a matplotlib title includes a newline, it now properly reflects that new line in the tex.

"test_secondary_legend_entries" tests for a double axis, which was the issue we previously discussed. The example code is the same from the open issue. Currently, the only lasting issue on that matter is the extra arrowhead on the right side of the y-axis, but it accomplishes the task of adding both axes titles to the legend.

There's other small issues I've fixed, one with a strange white patch appearing in some plots. I also added support for graph clipping, which previously raised a NotImplementedError. This is used when a graph is created, but the x/y are limited so that only a portion of the graph is shown (perhaps to highlight/zoom in on a particular section of the graph). The code only effects graphs that would have previously thrown a NotImplementedError.

Let me know if you have any questions.

Alex.

AlexChrzanowski and others added 16 commits September 22, 2025 12:46
Commented out a check to skip the functionality of _draw_rectangle() if the rectangle has no label. This was done intentionally, but had unintended consequences.
Previously, if you were to put '\n' in your title to make a newline, it would not translate to the tex code, and instead would be eaten by the transformation. Now, it should add \\ instead, which won't be eaten, and add  "title style={align=center}" which is needed for the \\ to work. Could also change this to be more customizable (e.g. align=left, align=right) if needed.
Changed get_legend_text() in _util.py, added an import _util in _save.py and added support for dependent plots in _process_axes, and added a separate option for dependent plots in draw_line2d in _line2d.py
Fixed previous issues in _draw_rect() in _patch.py, rolled back to a previous version (current ver of matplot2tikz). Added a test case for double axis graphs.
Removed unnecessary checking for '\\' when newlines will be represented with '\n' in python.
@ErwindeGelder
Copy link
Copy Markdown
Owner

Thanks a lot for your work!
Unfortunately, I still run into errors. The following tests fail:

  • test_arrows.py
  • test_basic_sin.py
  • test_escape_chars.py
  • test_externalize_tables.py
  • \test_fancybox.py
  • test_line_color_marker.py

Perhaps some "failures" are fine and require an update of the specific reference.tex file.
I need more time (which I don't have right now) to look into this. Of course, feel free to look for yourself (or wait a bit longer ;) )

@AlexChrzanowski
Copy link
Copy Markdown
Contributor Author

I'll take a look when I can. All of the tests passed locally when I ran it yesterday, so I'll have to figure out what the disconnect is.

AlexChrzanowski and others added 2 commits February 3, 2026 11:28
Commit was causing issues with tests, added unnecessary text. Reverting to ensure correctness.
@AlexChrzanowski
Copy link
Copy Markdown
Contributor Author

I figured out the issue. Someone else pushed a commit to my main branch in between me opening the pull request and you running the tests. This change was causing the tests to fail. I've since reverted the change and it should pass all of the tests now. Let me know if there are still any issues.

@ErwindeGelder ErwindeGelder merged commit 601c823 into ErwindeGelder:main Feb 4, 2026
1 check passed
@ErwindeGelder
Copy link
Copy Markdown
Owner

Thanks a lot for your contribution @AlexChrzanowski ! I had to make a few changes to pass the lint checks, so now it passes all checks.

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