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

Percent sign (%) in descriptions (labels, titles, etc.) are not escaped #573

Open
benHeid opened this issue Mar 6, 2023 · 0 comments
Open

Comments

@benHeid
Copy link

benHeid commented Mar 6, 2023

Thank you for your really nice package, which simplifies my workflow of writing. However, I have found a small error in your code.

Python Code

plt.plot([0,2,4,5,6])
plt.suptitle("%")
tikzplotlib.save("test.tex")

Resulting tikz Code`

In the penultimate line the percent sign is not escaped, this results in an latex error because the closing bracket is now outcommented.

% This file was created with tikzplotlib v0.10.1.
\begin{tikzpicture}

\definecolor{darkgray176}{RGB}{176,176,176}
\definecolor{steelblue31119180}{RGB}{31,119,180}

\begin{axis}[
tick align=outside,
tick pos=left,
x grid style={darkgray176},
xmin=-0.2, xmax=4.2,
xtick style={color=black},
y grid style={darkgray176},
ymin=-0.3, ymax=6.3,
ytick style={color=black}
]
\addplot [semithick, steelblue31119180]
table {%
0 0
1 2
2 4
3 5
4 6
};
\end{axis}

\draw ({$(current bounding box.south west)!0.5!(current bounding box.south east)$}|-{$(current bounding box.south west)!0.98!(current bounding box.north west)$}) node[
  scale=0.6,
  anchor=north,
  text=black,
  rotate=0.0
]{%};
\end{tikzpicture}
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

No branches or pull requests

1 participant