Open andreassch opened 4 years ago
The UnboundLocalError can easily be fixed by inserting
is_area = False
at line 31 in _path.py. However, in the generated pgfplots file I still have to delete the lines corresponding to the nan data points to make it compile with (pdf)latex. Below you find the generated file with the lines in question commented out by me.
% This file was created by tikzplotlib v0.9.3.
\begin{tikzpicture}
\definecolor{color0}{rgb}{0.12156862745098,0.466666666666667,0.705882352941177}
\begin{axis}[
tick align=outside,
tick pos=left,
x grid style={white!69.0196078431373!black},
xmin=-0.54, xmax=2.54,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
ymin=0, ymax=6.3,
ytick style={color=black}
]
\draw[draw=none,fill=color0] (axis cs:-0.4,0) rectangle (axis cs:0.4,1);
\draw[draw=none,fill=color0] (axis cs:0.6,0) rectangle (axis cs:1.4,2);
\draw[draw=none,fill=color0] (axis cs:1.6,0) rectangle (axis cs:2.4,3);
%\draw[draw=none,fill=color0] (axis cs:2.6,0) rectangle (axis cs:3.4,nan);
\path [draw=black, semithick]
(axis cs:0,0)
--(axis cs:0,2);
\path [draw=black, semithick]
(axis cs:1,0)
--(axis cs:1,4);
\path [draw=black, semithick]
(axis cs:2,0)
--(axis cs:2,6);
%\path [draw=black, semithick]
%;
\end{axis}
\end{tikzpicture}
Converting a bar plot with error bars which includes nan data produces a UnboundLocalError in _path.py. With the following minimal example
I get the following exception:
The function shouldn't return an uninitialized variable. I would expect an output plot which has no bar/errorbar at the place of the nan data point. I'm using tikzplotlib 0.9.3 installed via pip and Python 3.7.