nschloe / tikzplotlib

:bar_chart: Save matplotlib figures as TikZ/PGFplots for smooth integration into LaTeX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test failures with matplotlib 3.4.2

mgorny opened this issue · comments

Upon running the test suite of 0.9.11 release, I get the following test failures. This is with texlive 2021, matplotlib 3.4.2, numpy 1.21.1.

============================================================== FAILURES ===============================================================
________________________________________________________________ test _________________________________________________________________

    def test():
        from .helpers import assert_equality
    
>       assert_equality(plot, "test_barchart_errorbars_reference.tex")

assert_equality = <function assert_equality at 0x7fe96296a280>

tests/test_barchart_errorbars.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

plot = <function plot at 0x7fe964a50700>, filename = 'test_barchart_errorbars_reference.tex', assert_compilation = False
flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ntick align=outside,\ntick pos=left,\nx grid style={white!69.019608!black},\nx...=8, mark options={solid}, only marks]\ntable {%\n0.25 5.1\n1.25 3.2\n2.25 1.1\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')
f = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_barchart_errorbars_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ntick align=outside,\ntick pos=left,\nx grid style={white!69.019608!black},\nx...=8, mark options={solid}, only marks]\ntable {%\n0.25 5.1\n1.25 3.2\n2.25 1.1\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
@py_assert1 = False
@py_format3 = "('\\\\begin{tikzpicture}\\n'\\n '\\n'\\n '\\\\begin{axis}[\\n'\\n 'tick align=outside,\\n'\\n 'tick pos=left,\\n'\\n ...      ^^^   ^^^\n~  table {%\n~  0.25 5.1\n~  1.25 3.2\n~  2.25 1.1\n~  };\n~  \\end{axis}\n~  \n~  \\end{tikzpicture}"
@py_format5 = 'test_barchart_errorbars_reference.tex\n~--- \n~+++ \n~@@ -55,37 +55,37 @@\n~ (axis cs:2.25,0.9)\n~ --(axis cs:2.25,1....      ^^^   ^^^\n~  table {%\n~  0.25 5.1\n~  1.25 3.2\n~  2.25 1.1\n~  };\n~  \\end{axis}\n~  \n~  \\end{tikzpicture}'

    def assert_equality(
        plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
    ):
        plot()
        code = tikzplotlib.get_tikz_code(
            include_disclaimer=False,
            float_format=".8g",
            flavor=flavor,
            **extra_get_tikz_code_args,
        )
        plt.close()
    
        this_dir = pathlib.Path(__file__).resolve().parent
        with open(this_dir / filename, encoding="utf-8") as f:
            reference = f.read()
>       assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E       AssertionError: test_barchart_errorbars_reference.tex
E         --- 
E         +++ 
E         @@ -55,37 +55,37 @@
E          (axis cs:2.25,0.9)
E          --(axis cs:2.25,1.1);
E          
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          -0.25 0.9
E          0.75 1.8
E          1.75 2.5
E          };
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          -0.25 1.1
E          0.75 2.2
E          1.75 3.5
E          };
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          0 2.6
E          1 1.8
E          2 3.5
E          };
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          0 3.4
E          1 2.2
E          2 4.5
E          };
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          0.25 4.9
E          1.25 2.8
E          2.25 0.9
E          };
E         -\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E          table {%
E          0.25 5.1
E          1.25 3.2
E         
E       assert ('\\begin{tikzpicture}\n'\n '\n'\n '\\begin{axis}[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xmin=-0.5125, xmax=2.5125,\n'\n 'xtick style={color=black},\n'\n 'y grid style={white!69.019608!black},\n'\n 'ymin=0, ymax=5.355,\n'\n 'ytick style={color=black}\n'\n ']\n'\n '\\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis '\n 'cs:-0.125,1);\n'\n '\\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);\n'\n '\\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:-0.125,0) rectangle (axis '\n 'cs:0.125,3);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:0.875,0) rectangle (axis '\n 'cs:1.125,2);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:1.875,0) rectangle (axis '\n 'cs:2.125,4);\n'\n '\\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);\n'\n '\\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);\n'\n '\\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:-0.25,0.9)\n'\n '--(axis cs:-0.25,1.1);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0.75,1.8)\n'\n '--(axis cs:0.75,2.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1.75,2.5)\n'\n '--(axis cs:1.75,3.5);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0,2.6)\n'\n '--(axis cs:0,3.4);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1,1.8)\n'\n '--(axis cs:1,2.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:2,3.5)\n'\n '--(axis cs:2,4.5);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0.25,4.9)\n'\n '--(axis cs:0.25,5.1);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1.25,2.8)\n'\n '--(axis cs:1.25,3.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:2.25,0.9)\n'\n '--(axis cs:2.25,1.1);\n'\n '\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '-0.25 0.9\n'\n '0.75 1.8\n'\n '1.75 2.5\n'\n '};\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '-0.25 1.1\n'\n '0.75 2.2\n'\n '1.75 3.5\n'\n '};\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '0 2.6\n'\n '1 1.8\n'\n '2 3.5\n'\n '};\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '0 3.4\n'\n '1 2.2\n'\n '2 4.5\n'\n '};\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '0.25 4.9\n'\n '1.25 2.8\n'\n '2.25 0.9\n'\n '};\n'\n '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '\n 'marks]\n'\n 'table {%\n'\n '0.25 5.1\n'\n '1.25 3.2\n'\n '2.25 1.1\n'\n '};\n'\n '\\end{axis}\n'\n '\n'\n '\\end{tikzpicture}\n') == ('\\begin{tikzpicture}\n'\n '\n'\n '\\begin{axis}[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xmin=-0.5125, xmax=2.5125,\n'\n 'xtick style={color=black},\n'\n 'y grid style={white!69.019608!black},\n'\n 'ymin=0, ymax=5.355,\n'\n 'ytick style={color=black}\n'\n ']\n'\n '\\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis '\n 'cs:-0.125,1);\n'\n '\\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);\n'\n '\\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:-0.125,0) rectangle (axis '\n 'cs:0.125,3);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:0.875,0) rectangle (axis '\n 'cs:1.125,2);\n'\n '\\draw[draw=none,fill=green!50!black] (axis cs:1.875,0) rectangle (axis '\n 'cs:2.125,4);\n'\n '\\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);\n'\n '\\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);\n'\n '\\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:-0.25,0.9)\n'\n '--(axis cs:-0.25,1.1);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0.75,1.8)\n'\n '--(axis cs:0.75,2.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1.75,2.5)\n'\n '--(axis cs:1.75,3.5);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0,2.6)\n'\n '--(axis cs:0,3.4);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1,1.8)\n'\n '--(axis cs:1,2.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:2,3.5)\n'\n '--(axis cs:2,4.5);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:0.25,4.9)\n'\n '--(axis cs:0.25,5.1);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:1.25,2.8)\n'\n '--(axis cs:1.25,3.2);\n'\n '\n'\n '\\path [draw=black, line width=2pt]\n'\n '(axis cs:2.25,0.9)\n'\n '--(axis cs:2.25,1.1);\n'\n '\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '-0.25 0.9\n'\n '0.75 1.8\n'\n '1.75 2.5\n'\n '};\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '-0.25 1.1\n'\n '0.75 2.2\n'\n '1.75 3.5\n'\n '};\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '0 2.6\n'\n '1 1.8\n'\n '2 3.5\n'\n '};\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '0 3.4\n'\n '1 2.2\n'\n '2 4.5\n'\n '};\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '0.25 4.9\n'\n '1.25 2.8\n'\n '2.25 0.9\n'\n '};\n'\n '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '\n 'only marks]\n'\n 'table {%\n'\n '0.25 5.1\n'\n '1.25 3.2\n'\n '2.25 1.1\n'\n '};\n'\n '\\end{axis}\n'\n '\n'\n '\\end{tikzpicture}\n')
E           \begin{tikzpicture}
E           
E           \begin{axis}[
E           tick align=outside,
E           tick pos=left,
E           x grid style={white!69.019608!black},
E           xmin=-0.5125, xmax=2.5125,
E           xtick style={color=black},
E           y grid style={white!69.019608!black},
E           ymin=0, ymax=5.355,
E           ytick style={color=black}
E           ]
E           \draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
E           \draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
E           \draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
E           \draw[draw=none,fill=green!50!black] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
E           \draw[draw=none,fill=green!50!black] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
E           \draw[draw=none,fill=green!50!black] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
E           \draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
E           \draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
E           \draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
E           \path [draw=black, line width=2pt]
E           (axis cs:-0.25,0.9)
E           --(axis cs:-0.25,1.1);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:0.75,1.8)
E           --(axis cs:0.75,2.2);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:1.75,2.5)
E           --(axis cs:1.75,3.5);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:0,2.6)
E           --(axis cs:0,3.4);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:1,1.8)
E           --(axis cs:1,2.2);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:2,3.5)
E           --(axis cs:2,4.5);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:0.25,4.9)
E           --(axis cs:0.25,5.1);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:1.25,2.8)
E           --(axis cs:1.25,3.2);
E           
E           \path [draw=black, line width=2pt]
E           (axis cs:2.25,0.9)
E           --(axis cs:2.25,1.1);
E           
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           -0.25 0.9
E           0.75 1.8
E           1.75 2.5
E           };
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           -0.25 1.1
E           0.75 2.2
E           1.75 3.5
E           };
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           0 2.6
E           1 1.8
E           2 3.5
E           };
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           0 3.4
E           1 2.2
E           2 4.5
E           };
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           0.25 4.9
E           1.25 2.8
E           2.25 0.9
E           };
E         - \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^ ------  ^^^^
E         + \addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only marks]
E         ?           ^^^   ^^^
E           table {%
E           0.25 5.1
E           1.25 3.2
E           2.25 1.1
E           };
E           \end{axis}
E           
E           \end{tikzpicture}

assert_compilation = False
code       = ('\\begin{tikzpicture}\n'
 '\n'
 '\\begin{axis}[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xmin=-0.5125, xmax=2.5125,\n'
 'xtick style={color=black},\n'
 'y grid style={white!69.019608!black},\n'
 'ymin=0, ymax=5.355,\n'
 'ytick style={color=black}\n'
 ']\n'
 '\\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis '
 'cs:-0.125,1);\n'
 '\\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);\n'
 '\\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:-0.125,0) rectangle (axis '
 'cs:0.125,3);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:0.875,0) rectangle (axis '
 'cs:1.125,2);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:1.875,0) rectangle (axis '
 'cs:2.125,4);\n'
 '\\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);\n'
 '\\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);\n'
 '\\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:-0.25,0.9)\n'
 '--(axis cs:-0.25,1.1);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0.75,1.8)\n'
 '--(axis cs:0.75,2.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1.75,2.5)\n'
 '--(axis cs:1.75,3.5);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0,2.6)\n'
 '--(axis cs:0,3.4);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1,1.8)\n'
 '--(axis cs:1,2.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:2,3.5)\n'
 '--(axis cs:2,4.5);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0.25,4.9)\n'
 '--(axis cs:0.25,5.1);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1.25,2.8)\n'
 '--(axis cs:1.25,3.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:2.25,0.9)\n'
 '--(axis cs:2.25,1.1);\n'
 '\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '-0.25 0.9\n'
 '0.75 1.8\n'
 '1.75 2.5\n'
 '};\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '-0.25 1.1\n'
 '0.75 2.2\n'
 '1.75 3.5\n'
 '};\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '0 2.6\n'
 '1 1.8\n'
 '2 3.5\n'
 '};\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '0 3.4\n'
 '1 2.2\n'
 '2 4.5\n'
 '};\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '0.25 4.9\n'
 '1.25 2.8\n'
 '2.25 0.9\n'
 '};\n'
 '\\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, '
 'only marks]\n'
 'table {%\n'
 '0.25 5.1\n'
 '1.25 3.2\n'
 '2.25 1.1\n'
 '};\n'
 '\\end{axis}\n'
 '\n'
 '\\end{tikzpicture}\n')
extra_get_tikz_code_args = {}
f          = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_barchart_errorbars_reference.tex' mode='r' encoding='utf-8'>
filename   = 'test_barchart_errorbars_reference.tex'
flavor     = 'latex'
plot       = <function plot at 0x7fe964a50700>
reference  = ('\\begin{tikzpicture}\n'
 '\n'
 '\\begin{axis}[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xmin=-0.5125, xmax=2.5125,\n'
 'xtick style={color=black},\n'
 'y grid style={white!69.019608!black},\n'
 'ymin=0, ymax=5.355,\n'
 'ytick style={color=black}\n'
 ']\n'
 '\\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis '
 'cs:-0.125,1);\n'
 '\\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);\n'
 '\\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:-0.125,0) rectangle (axis '
 'cs:0.125,3);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:0.875,0) rectangle (axis '
 'cs:1.125,2);\n'
 '\\draw[draw=none,fill=green!50!black] (axis cs:1.875,0) rectangle (axis '
 'cs:2.125,4);\n'
 '\\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);\n'
 '\\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);\n'
 '\\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:-0.25,0.9)\n'
 '--(axis cs:-0.25,1.1);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0.75,1.8)\n'
 '--(axis cs:0.75,2.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1.75,2.5)\n'
 '--(axis cs:1.75,3.5);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0,2.6)\n'
 '--(axis cs:0,3.4);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1,1.8)\n'
 '--(axis cs:1,2.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:2,3.5)\n'
 '--(axis cs:2,4.5);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:0.25,4.9)\n'
 '--(axis cs:0.25,5.1);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:1.25,2.8)\n'
 '--(axis cs:1.25,3.2);\n'
 '\n'
 '\\path [draw=black, line width=2pt]\n'
 '(axis cs:2.25,0.9)\n'
 '--(axis cs:2.25,1.1);\n'
 '\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '-0.25 0.9\n'
 '0.75 1.8\n'
 '1.75 2.5\n'
 '};\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '-0.25 1.1\n'
 '0.75 2.2\n'
 '1.75 3.5\n'
 '};\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '0 2.6\n'
 '1 1.8\n'
 '2 3.5\n'
 '};\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '0 3.4\n'
 '1 2.2\n'
 '2 4.5\n'
 '};\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '0.25 4.9\n'
 '1.25 2.8\n'
 '2.25 0.9\n'
 '};\n'
 '\\addplot [semithick, black, mark=-, mark size=8, mark options={solid}, only '
 'marks]\n'
 'table {%\n'
 '0.25 5.1\n'
 '1.25 3.2\n'
 '2.25 1.1\n'
 '};\n'
 '\\end{axis}\n'
 '\n'
 '\\end{tikzpicture}\n')
this_dir   = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')

tests/helpers.py:48: AssertionError
________________________________________________________________ test _________________________________________________________________

    def test():
        from .helpers import assert_equality
    
>       assert_equality(plot, "test_colorbars_reference.tex", assert_compilation=False)

assert_equality = <function assert_equality at 0x7fe96296a280>

tests/test_colorbars.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

plot = <function plot at 0x7fe962b57430>, filename = 'test_colorbars_reference.tex', assert_compilation = False, flavor = 'latex'
extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{groupplot}[group style={group size=1 by 3}]\n\\nextgroupplot[\ntick align=outside,\nt...graphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, ymin=-1, ymax=1] {tmp-002.png};\n\\end{groupplot}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')
f = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_colorbars_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{groupplot}[group style={group size=1 by 3}]\n\\nextgroupplot[\ntick align=outside,\nt...s cs:1.5,0)\n--(axis cs:1,1)\n--(axis cs:-1,1)\n--(axis cs:-1.5,0)\n--cycle;\n\\end{groupplot}\n\n\\end{tikzpicture}\n'
@py_assert1 = False
@py_format3 = "('\\\\begin{tikzpicture}\\n'\\n '\\n'\\n '\\\\begin{groupplot}[group style={group size=1 by 3}]\\n'\\n '\\\\nextgroup...axis cs:1,1)\n~+ --(axis cs:-1,1)\n~+ --(axis cs:-1.5,0)\n~+ --cycle;\n~  \\end{groupplot}\n~  \n~  \\end{tikzpicture}"
@py_format5 = 'test_colorbars_reference.tex\n~--- \n~+++ \n~@@ -19,18 +19,9 @@\n~ --(axis cs:9.9414062,10)\n~ --(axis cs:-4.9414062,...axis cs:1,1)\n~+ --(axis cs:-1,1)\n~+ --(axis cs:-1.5,0)\n~+ --cycle;\n~  \\end{groupplot}\n~  \n~  \\end{tikzpicture}'

    def assert_equality(
        plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
    ):
        plot()
        code = tikzplotlib.get_tikz_code(
            include_disclaimer=False,
            float_format=".8g",
            flavor=flavor,
            **extra_get_tikz_code_args,
        )
        plt.close()
    
        this_dir = pathlib.Path(__file__).resolve().parent
        with open(this_dir / filename, encoding="utf-8") as f:
            reference = f.read()
>       assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E       AssertionError: test_colorbars_reference.tex
E         --- 
E         +++ 
E         @@ -19,18 +19,9 @@
E          --(axis cs:9.9414062,10)
E          --(axis cs:-4.9414062,10)
E          --(axis cs:-5,10)
E         +--(axis cs:-5,10)
E          --cycle;
E          \addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=-5, ymax=10] {tmp-000.png};
E         -\path [draw=black, line width=0.32pt]
E         -(axis cs:-5,-5)
E         ---(axis cs:-4.9414062,-5)
E         ---(axis cs:9.9414062,-5)
E         ---(axis cs:10,-5)
E         ---(axis cs:10,10)
E         ---(axis cs:9.9414062,10)
E         ---(axis cs:-4.9414062,10)
E         ---(axis cs:-5,10)
E         ---cycle;
E          
E          \nextgroupplot[
E          tick align=outside,
E         @@ -54,16 +45,6 @@
E          --(axis cs:0.65,4.5)
E          --cycle;
E          \addplot graphics [includegraphics cmd=\pgfimage,xmin=0.65, xmax=8.35, ymin=1, ymax=8] {tmp-001.png};
E         -\path [draw=black, line width=0.32pt]
E         -(axis cs:0.65,4.5)
E         ---(axis cs:1,1)
E         ---(axis cs:8,1)
E         ---(axis cs:8.35,4.5)
E         ---(axis cs:8.35,4.5)
E         ---(axis cs:8,8)
E         ---(axis cs:1,8)
E         ---(axis cs:0.65,4.5)
E         ---cycle;
E          
E          \nextgroupplot[
E          tick align=outside,
E         @@ -72,6 +53,8 @@
E          xlabel={Custom extension lengths, some other units},
E          xmin=-1.5, xmax=1.5,
E          xtick style={color=black},
E         +xtick={-1,-0.5,0,0.5,1},
E         +xticklabels={\ensuremath{-}1.0,\ensuremath{-}0.5,0.0,0.5,1.0},
E          ymin=-1, ymax=1
E          ]
E          \path [draw=white, fill=white, line width=0.004pt]
E         @@ -85,16 +68,6 @@
E          --(axis cs:-1.5,0)
E          --cycle;
E          \addplot graphics [includegraphics cmd=\pgfimage,xmin=-1.5, xmax=1.5, ymin=-1, ymax=1] {tmp-002.png};
E         -\path [draw=black, line width=0.32pt]
E         -(axis cs:-1.5,0)
E         ---(axis cs:-1,-1)
E         ---(axis cs:1,-1)
E         ---(axis cs:1.5,0)
E         ---(axis cs:1.5,0)
E         ---(axis cs:1,1)
E         ---(axis cs:-1,1)
E         ---(axis cs:-1.5,0)
E         ---cycle;
E          \end{groupplot}
E          
E          \end{tikzpicture}
E         
E       assert ('\\begin{tikzpicture}\n'\n '\n'\n '\\begin{groupplot}[group style={group size=1 by 3}]\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Some Units},\n'\n 'xmin=-5, xmax=10,\n'\n 'xtick style={color=black},\n'\n 'ymin=-5, ymax=10\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:-5,-5)\n'\n '--(axis cs:-4.9414062,-5)\n'\n '--(axis cs:9.9414062,-5)\n'\n '--(axis cs:10,-5)\n'\n '--(axis cs:10,10)\n'\n '--(axis cs:9.9414062,10)\n'\n '--(axis cs:-4.9414062,10)\n'\n '--(axis cs:-5,10)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-5, xmax=10, '\n 'ymin=-5, ymax=10] {tmp-000.png};\n'\n '\\path [draw=black, line width=0.32pt]\n'\n '(axis cs:-5,-5)\n'\n '--(axis cs:-4.9414062,-5)\n'\n '--(axis cs:9.9414062,-5)\n'\n '--(axis cs:10,-5)\n'\n '--(axis cs:10,10)\n'\n '--(axis cs:9.9414062,10)\n'\n '--(axis cs:-4.9414062,10)\n'\n '--(axis cs:-5,10)\n'\n '--cycle;\n'\n '\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Discrete intervals, some other units},\n'\n 'xmin=0.65, xmax=8.35,\n'\n 'xtick style={color=black},\n'\n 'xtick={1,2,4,7,8},\n'\n 'xticklabels={1,2,4,7,8},\n'\n 'ymin=1, ymax=8\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:0.65,4.5)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:8,1)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8,8)\n'\n '--(axis cs:1,8)\n'\n '--(axis cs:0.65,4.5)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0.65, xmax=8.35, '\n 'ymin=1, ymax=8] {tmp-001.png};\n'\n '\\path [draw=black, line width=0.32pt]\n'\n '(axis cs:0.65,4.5)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:8,1)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8,8)\n'\n '--(axis cs:1,8)\n'\n '--(axis cs:0.65,4.5)\n'\n '--cycle;\n'\n '\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Custom extension lengths, some other units},\n'\n 'xmin=-1.5, xmax=1.5,\n'\n 'xtick style={color=black},\n'\n 'ymin=-1, ymax=1\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:-1.5,0)\n'\n '--(axis cs:-1,-1)\n'\n '--(axis cs:1,-1)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:-1,1)\n'\n '--(axis cs:-1.5,0)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, '\n 'ymin=-1, ymax=1] {tmp-002.png};\n'\n '\\path [draw=black, line width=0.32pt]\n'\n '(axis cs:-1.5,0)\n'\n '--(axis cs:-1,-1)\n'\n '--(axis cs:1,-1)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:-1,1)\n'\n '--(axis cs:-1.5,0)\n'\n '--cycle;\n'\n '\\end{groupplot}\n'\n '\n'\n '\\end{tikzpicture}\n') == ('\\begin{tikzpicture}\n'\n '\n'\n '\\begin{groupplot}[group style={group size=1 by 3}]\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Some Units},\n'\n 'xmin=-5, xmax=10,\n'\n 'xtick style={color=black},\n'\n 'ymin=-5, ymax=10\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:-5,-5)\n'\n '--(axis cs:-4.9414062,-5)\n'\n '--(axis cs:9.9414062,-5)\n'\n '--(axis cs:10,-5)\n'\n '--(axis cs:10,10)\n'\n '--(axis cs:9.9414062,10)\n'\n '--(axis cs:-4.9414062,10)\n'\n '--(axis cs:-5,10)\n'\n '--(axis cs:-5,10)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-5, xmax=10, '\n 'ymin=-5, ymax=10] {tmp-000.png};\n'\n '\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Discrete intervals, some other units},\n'\n 'xmin=0.65, xmax=8.35,\n'\n 'xtick style={color=black},\n'\n 'xtick={1,2,4,7,8},\n'\n 'xticklabels={1,2,4,7,8},\n'\n 'ymin=1, ymax=8\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:0.65,4.5)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:8,1)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8.35,4.5)\n'\n '--(axis cs:8,8)\n'\n '--(axis cs:1,8)\n'\n '--(axis cs:0.65,4.5)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0.65, xmax=8.35, '\n 'ymin=1, ymax=8] {tmp-001.png};\n'\n '\n'\n '\\nextgroupplot[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xlabel={Custom extension lengths, some other units},\n'\n 'xmin=-1.5, xmax=1.5,\n'\n 'xtick style={color=black},\n'\n 'xtick={-1,-0.5,0,0.5,1},\n'\n 'xticklabels={\\ensuremath{-}1.0,\\ensuremath{-}0.5,0.0,0.5,1.0},\n'\n 'ymin=-1, ymax=1\n'\n ']\n'\n '\\path [draw=white, fill=white, line width=0.004pt]\n'\n '(axis cs:-1.5,0)\n'\n '--(axis cs:-1,-1)\n'\n '--(axis cs:1,-1)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1.5,0)\n'\n '--(axis cs:1,1)\n'\n '--(axis cs:-1,1)\n'\n '--(axis cs:-1.5,0)\n'\n '--cycle;\n'\n '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, '\n 'ymin=-1, ymax=1] {tmp-002.png};\n'\n '\\end{groupplot}\n'\n '\n'\n '\\end{tikzpicture}\n')
E           \begin{tikzpicture}
E           
E           \begin{groupplot}[group style={group size=1 by 3}]
E           \nextgroupplot[
E           tick align=outside,
E           tick pos=left,
E           x grid style={white!69.019608!black},
E           xlabel={Some Units},
E           xmin=-5, xmax=10,
E           xtick style={color=black},
E           ymin=-5, ymax=10
E           ]
E           \path [draw=white, fill=white, line width=0.004pt]
E           (axis cs:-5,-5)
E           --(axis cs:-4.9414062,-5)
E           --(axis cs:9.9414062,-5)
E           --(axis cs:10,-5)
E           --(axis cs:10,10)
E           --(axis cs:9.9414062,10)
E           --(axis cs:-4.9414062,10)
E           --(axis cs:-5,10)
E         + --cycle;
E         + \addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=-5, ymax=10] {tmp-000.png};
E         + \path [draw=black, line width=0.32pt]
E         + (axis cs:-5,-5)
E         + --(axis cs:-4.9414062,-5)
E         + --(axis cs:9.9414062,-5)
E         + --(axis cs:10,-5)
E         + --(axis cs:10,10)
E         + --(axis cs:9.9414062,10)
E         + --(axis cs:-4.9414062,10)
E           --(axis cs:-5,10)
E           --cycle;
E         - \addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=-5, ymax=10] {tmp-000.png};
E           
E           \nextgroupplot[
E           tick align=outside,
E           tick pos=left,
E           x grid style={white!69.019608!black},
E           xlabel={Discrete intervals, some other units},
E           xmin=0.65, xmax=8.35,
E           xtick style={color=black},
E           xtick={1,2,4,7,8},
E           xticklabels={1,2,4,7,8},
E           ymin=1, ymax=8
E           ]
E           \path [draw=white, fill=white, line width=0.004pt]
E           (axis cs:0.65,4.5)
E           --(axis cs:1,1)
E           --(axis cs:8,1)
E           --(axis cs:8.35,4.5)
E           --(axis cs:8.35,4.5)
E           --(axis cs:8,8)
E           --(axis cs:1,8)
E           --(axis cs:0.65,4.5)
E           --cycle;
E           \addplot graphics [includegraphics cmd=\pgfimage,xmin=0.65, xmax=8.35, ymin=1, ymax=8] {tmp-001.png};
E         + \path [draw=black, line width=0.32pt]
E         + (axis cs:0.65,4.5)
E         + --(axis cs:1,1)
E         + --(axis cs:8,1)
E         + --(axis cs:8.35,4.5)
E         + --(axis cs:8.35,4.5)
E         + --(axis cs:8,8)
E         + --(axis cs:1,8)
E         + --(axis cs:0.65,4.5)
E         + --cycle;
E           
E           \nextgroupplot[
E           tick align=outside,
E           tick pos=left,
E           x grid style={white!69.019608!black},
E           xlabel={Custom extension lengths, some other units},
E           xmin=-1.5, xmax=1.5,
E           xtick style={color=black},
E         - xtick={-1,-0.5,0,0.5,1},
E         - xticklabels={\ensuremath{-}1.0,\ensuremath{-}0.5,0.0,0.5,1.0},
E           ymin=-1, ymax=1
E           ]
E           \path [draw=white, fill=white, line width=0.004pt]
E           (axis cs:-1.5,0)
E           --(axis cs:-1,-1)
E           --(axis cs:1,-1)
E           --(axis cs:1.5,0)
E           --(axis cs:1.5,0)
E           --(axis cs:1,1)
E           --(axis cs:-1,1)
E           --(axis cs:-1.5,0)
E           --cycle;
E           \addplot graphics [includegraphics cmd=\pgfimage,xmin=-1.5, xmax=1.5, ymin=-1, ymax=1] {tmp-002.png};
E         + \path [draw=black, line width=0.32pt]
E         + (axis cs:-1.5,0)
E         + --(axis cs:-1,-1)
E         + --(axis cs:1,-1)
E         + --(axis cs:1.5,0)
E         + --(axis cs:1.5,0)
E         + --(axis cs:1,1)
E         + --(axis cs:-1,1)
E         + --(axis cs:-1.5,0)
E         + --cycle;
E           \end{groupplot}
E           
E           \end{tikzpicture}

assert_compilation = False
code       = ('\\begin{tikzpicture}\n'
 '\n'
 '\\begin{groupplot}[group style={group size=1 by 3}]\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Some Units},\n'
 'xmin=-5, xmax=10,\n'
 'xtick style={color=black},\n'
 'ymin=-5, ymax=10\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:-5,-5)\n'
 '--(axis cs:-4.9414062,-5)\n'
 '--(axis cs:9.9414062,-5)\n'
 '--(axis cs:10,-5)\n'
 '--(axis cs:10,10)\n'
 '--(axis cs:9.9414062,10)\n'
 '--(axis cs:-4.9414062,10)\n'
 '--(axis cs:-5,10)\n'
 '--(axis cs:-5,10)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-5, xmax=10, '
 'ymin=-5, ymax=10] {tmp-000.png};\n'
 '\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Discrete intervals, some other units},\n'
 'xmin=0.65, xmax=8.35,\n'
 'xtick style={color=black},\n'
 'xtick={1,2,4,7,8},\n'
 'xticklabels={1,2,4,7,8},\n'
 'ymin=1, ymax=8\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:0.65,4.5)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:8,1)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8,8)\n'
 '--(axis cs:1,8)\n'
 '--(axis cs:0.65,4.5)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0.65, xmax=8.35, '
 'ymin=1, ymax=8] {tmp-001.png};\n'
 '\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Custom extension lengths, some other units},\n'
 'xmin=-1.5, xmax=1.5,\n'
 'xtick style={color=black},\n'
 'xtick={-1,-0.5,0,0.5,1},\n'
 'xticklabels={\\ensuremath{-}1.0,\\ensuremath{-}0.5,0.0,0.5,1.0},\n'
 'ymin=-1, ymax=1\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:-1.5,0)\n'
 '--(axis cs:-1,-1)\n'
 '--(axis cs:1,-1)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:-1,1)\n'
 '--(axis cs:-1.5,0)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, '
 'ymin=-1, ymax=1] {tmp-002.png};\n'
 '\\end{groupplot}\n'
 '\n'
 '\\end{tikzpicture}\n')
extra_get_tikz_code_args = {}
f          = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_colorbars_reference.tex' mode='r' encoding='utf-8'>
filename   = 'test_colorbars_reference.tex'
flavor     = 'latex'
plot       = <function plot at 0x7fe962b57430>
reference  = ('\\begin{tikzpicture}\n'
 '\n'
 '\\begin{groupplot}[group style={group size=1 by 3}]\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Some Units},\n'
 'xmin=-5, xmax=10,\n'
 'xtick style={color=black},\n'
 'ymin=-5, ymax=10\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:-5,-5)\n'
 '--(axis cs:-4.9414062,-5)\n'
 '--(axis cs:9.9414062,-5)\n'
 '--(axis cs:10,-5)\n'
 '--(axis cs:10,10)\n'
 '--(axis cs:9.9414062,10)\n'
 '--(axis cs:-4.9414062,10)\n'
 '--(axis cs:-5,10)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-5, xmax=10, '
 'ymin=-5, ymax=10] {tmp-000.png};\n'
 '\\path [draw=black, line width=0.32pt]\n'
 '(axis cs:-5,-5)\n'
 '--(axis cs:-4.9414062,-5)\n'
 '--(axis cs:9.9414062,-5)\n'
 '--(axis cs:10,-5)\n'
 '--(axis cs:10,10)\n'
 '--(axis cs:9.9414062,10)\n'
 '--(axis cs:-4.9414062,10)\n'
 '--(axis cs:-5,10)\n'
 '--cycle;\n'
 '\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Discrete intervals, some other units},\n'
 'xmin=0.65, xmax=8.35,\n'
 'xtick style={color=black},\n'
 'xtick={1,2,4,7,8},\n'
 'xticklabels={1,2,4,7,8},\n'
 'ymin=1, ymax=8\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:0.65,4.5)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:8,1)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8,8)\n'
 '--(axis cs:1,8)\n'
 '--(axis cs:0.65,4.5)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=0.65, xmax=8.35, '
 'ymin=1, ymax=8] {tmp-001.png};\n'
 '\\path [draw=black, line width=0.32pt]\n'
 '(axis cs:0.65,4.5)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:8,1)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8.35,4.5)\n'
 '--(axis cs:8,8)\n'
 '--(axis cs:1,8)\n'
 '--(axis cs:0.65,4.5)\n'
 '--cycle;\n'
 '\n'
 '\\nextgroupplot[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xlabel={Custom extension lengths, some other units},\n'
 'xmin=-1.5, xmax=1.5,\n'
 'xtick style={color=black},\n'
 'ymin=-1, ymax=1\n'
 ']\n'
 '\\path [draw=white, fill=white, line width=0.004pt]\n'
 '(axis cs:-1.5,0)\n'
 '--(axis cs:-1,-1)\n'
 '--(axis cs:1,-1)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:-1,1)\n'
 '--(axis cs:-1.5,0)\n'
 '--cycle;\n'
 '\\addplot graphics [includegraphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, '
 'ymin=-1, ymax=1] {tmp-002.png};\n'
 '\\path [draw=black, line width=0.32pt]\n'
 '(axis cs:-1.5,0)\n'
 '--(axis cs:-1,-1)\n'
 '--(axis cs:1,-1)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1.5,0)\n'
 '--(axis cs:1,1)\n'
 '--(axis cs:-1,1)\n'
 '--(axis cs:-1.5,0)\n'
 '--cycle;\n'
 '\\end{groupplot}\n'
 '\n'
 '\\end{tikzpicture}\n')
this_dir   = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')

tests/helpers.py:48: AssertionError
________________________________________________________________ test _________________________________________________________________

    def test():
        from .helpers import assert_equality
    
>       assert_equality(plot, "test_fillstyle_reference.tex")

assert_equality = <function assert_equality at 0x7fe96296a280>

tests/test_fillstyle.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

plot = <function plot at 0x7fe962b7ef70>, filename = 'test_fillstyle_reference.tex', assert_compilation = False, flavor = 'latex'
extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ntick align=ou... 3\n0.44444444 4\n0.55555556 5\n0.66666667 6\n0.77777778 7\n0.88888889 8\n1 9\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')
f = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_fillstyle_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ntick align=ou... 3\n0.44444444 4\n0.55555556 5\n0.66666667 6\n0.77777778 7\n0.88888889 8\n1 9\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
@py_assert1 = False
@py_format3 = "('\\\\begin{tikzpicture}\\n'\\n '\\n'\\n '\\\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\\n'\\n '\\n'...555556 5\n~  0.66666667 6\n~  0.77777778 7\n~  0.88888889 8\n~  1 9\n~  };\n~  \\end{axis}\n~  \n~  \\end{tikzpicture}"
@py_format5 = 'test_fillstyle_reference.tex\n~--- \n~+++ \n~@@ -9,10 +9,12 @@\n~ xmin=-0.05, xmax=1.05,\n~ xtick style={color=black}...555556 5\n~  0.66666667 6\n~  0.77777778 7\n~  0.88888889 8\n~  1 9\n~  };\n~  \\end{axis}\n~  \n~  \\end{tikzpicture}'

    def assert_equality(
        plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
    ):
        plot()
        code = tikzplotlib.get_tikz_code(
            include_disclaimer=False,
            float_format=".8g",
            flavor=flavor,
            **extra_get_tikz_code_args,
        )
        plt.close()
    
        this_dir = pathlib.Path(__file__).resolve().parent
        with open(this_dir / filename, encoding="utf-8") as f:
            reference = f.read()
>       assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E       AssertionError: test_fillstyle_reference.tex
E         --- 
E         +++ 
E         @@ -9,10 +9,12 @@
E          xmin=-0.05, xmax=1.05,
E          xtick style={color=black},
E          xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},
E         -xticklabels={−0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},
E         +xticklabels={\ensuremath{-}0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},
E          y grid style={white!69.019608!black},
E          ymin=-0.45, ymax=9.45,
E         -ytick style={color=black}
E         +ytick style={color=black},
E         +ytick={-2,0,2,4,6,8,10},
E         +yticklabels={\ensuremath{-}2,0,2,4,6,8,10}
E          ]
E          \addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill opacity=0}]
E          table {%
E         
E       assert ('\\begin{tikzpicture}\n'\n '\n'\n '\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n'\n '\n'\n '\\begin{axis}[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xmin=-0.05, xmax=1.05,\n'\n 'xtick style={color=black},\n'\n 'xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},\n'\n 'xticklabels={−0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},\n'\n 'y grid style={white!69.019608!black},\n'\n 'ymin=-0.45, ymax=9.45,\n'\n 'ytick style={color=black}\n'\n ']\n'\n '\\addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill '\n 'opacity=0}]\n'\n 'table {%\n'\n '0 0\n'\n '0.11111111 1\n'\n '0.22222222 2\n'\n '0.33333333 3\n'\n '0.44444444 4\n'\n '0.55555556 5\n'\n '0.66666667 6\n'\n '0.77777778 7\n'\n '0.88888889 8\n'\n '1 9\n'\n '};\n'\n '\\end{axis}\n'\n '\n'\n '\\end{tikzpicture}\n') == ('\\begin{tikzpicture}\n'\n '\n'\n '\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n'\n '\n'\n '\\begin{axis}[\n'\n 'tick align=outside,\n'\n 'tick pos=left,\n'\n 'x grid style={white!69.019608!black},\n'\n 'xmin=-0.05, xmax=1.05,\n'\n 'xtick style={color=black},\n'\n 'xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},\n'\n 'xticklabels={\\ensuremath{-}0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},\n'\n 'y grid style={white!69.019608!black},\n'\n 'ymin=-0.45, ymax=9.45,\n'\n 'ytick style={color=black},\n'\n 'ytick={-2,0,2,4,6,8,10},\n'\n 'yticklabels={\\ensuremath{-}2,0,2,4,6,8,10}\n'\n ']\n'\n '\\addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill '\n 'opacity=0}]\n'\n 'table {%\n'\n '0 0\n'\n '0.11111111 1\n'\n '0.22222222 2\n'\n '0.33333333 3\n'\n '0.44444444 4\n'\n '0.55555556 5\n'\n '0.66666667 6\n'\n '0.77777778 7\n'\n '0.88888889 8\n'\n '1 9\n'\n '};\n'\n '\\end{axis}\n'\n '\n'\n '\\end{tikzpicture}\n')
E           \begin{tikzpicture}
E           
E           \definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}
E           
E           \begin{axis}[
E           tick align=outside,
E           tick pos=left,
E           x grid style={white!69.019608!black},
E           xmin=-0.05, xmax=1.05,
E           xtick style={color=black},
E           xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},
E         - xticklabels={\ensuremath{-}0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},
E         ?              ^^^^^^^^^^^^^^
E         + xticklabels={−0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},
E         ?              ^
E           y grid style={white!69.019608!black},
E           ymin=-0.45, ymax=9.45,
E         - ytick style={color=black},
E         ?                          -
E         + ytick style={color=black}
E         - ytick={-2,0,2,4,6,8,10},
E         - yticklabels={\ensuremath{-}2,0,2,4,6,8,10}
E           ]
E           \addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill opacity=0}]
E           table {%
E           0 0
E           0.11111111 1
E           0.22222222 2
E           0.33333333 3
E           0.44444444 4
E           0.55555556 5
E           0.66666667 6
E           0.77777778 7
E           0.88888889 8
E           1 9
E           };
E           \end{axis}
E           
E           \end{tikzpicture}

assert_compilation = False
code       = ('\\begin{tikzpicture}\n'
 '\n'
 '\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n'
 '\n'
 '\\begin{axis}[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xmin=-0.05, xmax=1.05,\n'
 'xtick style={color=black},\n'
 'xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},\n'
 'xticklabels={\\ensuremath{-}0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},\n'
 'y grid style={white!69.019608!black},\n'
 'ymin=-0.45, ymax=9.45,\n'
 'ytick style={color=black},\n'
 'ytick={-2,0,2,4,6,8,10},\n'
 'yticklabels={\\ensuremath{-}2,0,2,4,6,8,10}\n'
 ']\n'
 '\\addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill '
 'opacity=0}]\n'
 'table {%\n'
 '0 0\n'
 '0.11111111 1\n'
 '0.22222222 2\n'
 '0.33333333 3\n'
 '0.44444444 4\n'
 '0.55555556 5\n'
 '0.66666667 6\n'
 '0.77777778 7\n'
 '0.88888889 8\n'
 '1 9\n'
 '};\n'
 '\\end{axis}\n'
 '\n'
 '\\end{tikzpicture}\n')
extra_get_tikz_code_args = {}
f          = <_io.TextIOWrapper name='/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_fillstyle_reference.tex' mode='r' encoding='utf-8'>
filename   = 'test_fillstyle_reference.tex'
flavor     = 'latex'
plot       = <function plot at 0x7fe962b7ef70>
reference  = ('\\begin{tikzpicture}\n'
 '\n'
 '\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n'
 '\n'
 '\\begin{axis}[\n'
 'tick align=outside,\n'
 'tick pos=left,\n'
 'x grid style={white!69.019608!black},\n'
 'xmin=-0.05, xmax=1.05,\n'
 'xtick style={color=black},\n'
 'xtick={-0.2,0,0.2,0.4,0.6,0.8,1,1.2},\n'
 'xticklabels={−0.2,0.0,0.2,0.4,0.6,0.8,1.0,1.2},\n'
 'y grid style={white!69.019608!black},\n'
 'ymin=-0.45, ymax=9.45,\n'
 'ytick style={color=black}\n'
 ']\n'
 '\\addplot [semithick, color0, mark=o, mark size=3, mark options={solid,fill '
 'opacity=0}]\n'
 'table {%\n'
 '0 0\n'
 '0.11111111 1\n'
 '0.22222222 2\n'
 '0.33333333 3\n'
 '0.44444444 4\n'
 '0.55555556 5\n'
 '0.66666667 6\n'
 '0.77777778 7\n'
 '0.88888889 8\n'
 '1 9\n'
 '};\n'
 '\\end{axis}\n'
 '\n'
 '\\end{tikzpicture}\n')
this_dir   = PosixPath('/tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests')

tests/helpers.py:48: AssertionError
========================================================== warnings summary ===========================================================
tests/test_cleanfigure.py::Test_plottypes::test_surface3D
  /tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_cleanfigure.py:177: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
    ax = fig.gca(projection="3d")

tests/test_cleanfigure.py::Test_plottypes::test_trisurface3D
  /tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_cleanfigure.py:220: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
    ax = fig.gca(projection="3d")

tests/test_cleanfigure.py::Test_plottypes::test_polygon3D
  /tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_cleanfigure.py:247: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
    ax = fig.gca(projection="3d")

tests/test_cleanfigure.py::Test_plottypes::test_quiver3D
  /tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_cleanfigure.py:305: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
    ax = fig.gca(projection="3d")

tests/test_cleanfigure.py::Test_plottypes::test_2D_in_3D
  /tmp/portage/dev-python/tikzplotlib-0.9.11/work/tikzplotlib-0.9.11/tests/test_cleanfigure.py:332: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
    ax = fig.gca(projection="3d")

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================================================= short test summary info =======================================================
SKIPPED [1] tests/test_image_plot_upper.py:32: Fails?
SKIPPED [1] tests/test_legend_best_location.py:62: 'Best' location depends on window size.
SKIPPED [1] tests/test_subplots_with_colorbars.py:26: Fails?
FAILED tests/test_barchart_errorbars.py::test - AssertionError: test_barchart_errorbars_reference.tex
FAILED tests/test_colorbars.py::test - AssertionError: test_colorbars_reference.tex
FAILED tests/test_fillstyle.py::test - AssertionError: test_fillstyle_reference.tex
======================================== 3 failed, 102 passed, 3 skipped, 5 warnings in 23.43s ========================================

They're running fine on the ci. Not sure what the issue is locally.

If you could give me a tip on what to try, I could try figuring it out.

Probably a newer mpl version? The tests are running against whatever is in tox.ini.

Indeed that seems to be the cause. Could you please update the tests for new versions of matplotlib? 3.3.4 doesn't support Python 3.10 properly.

I can do it when I get to it, which can be a while. PRs welcome.

Ok, I'll give it a try.

I've updated the references for the three failing tests but I think there could be something else that needs fixing.

I've dumbly rendered the old and new reference .latex using xelatex, and I see two differences:

  1. The < and > thingies on two plots have disappeared.
  2. The error bars (?) on the color bars became thicker.

compare

I've created #503, so you can look at the diff.

The tests are now using 3.4.3.