mirkobunse / critdd

Critical difference diagrams with Python and Tikz
https://mirkobunse.github.io/critdd
Other
21 stars 3 forks source link

Underscore in treatment names not escaped #2

Closed MatthiasJakobs closed 1 year ago

MatthiasJakobs commented 1 year ago

If there are underscores in the treatment names, they are not escaped correctly so that compilation does not work.

File for reproduction:

\begin{tikzpicture}[
  treatment line/.style={rounded corners=1.5pt, line cap=round, shorten >=1pt},
  treatment label/.style={font=\small},
  group line/.style={ultra thick},
]

\begin{axis}[
  clip=false,
  axis x line=center,
  axis y line=none,
  axis line style={line cap=round},
  xmin=1,
  xmax=6,
  ymin=-4.5,
  ymax=0,
  scale only axis,
  height=5\baselineskip,
  width=\axisdefaultwidth,
  ticklabel style={anchor=south, yshift=1.3*\pgfkeysvalueof{/pgfplots/major tick length}, font=\small},
  every tick/.style={draw=black},
  major tick style={yshift=.5*\pgfkeysvalueof{/pgfplots/major tick length}},
  minor tick style={yshift=.5*\pgfkeysvalueof{/pgfplots/minor tick length}},
  axis line style={-},
  title style={yshift=\baselineskip},
  xtick={1,2,3,4,5,6},
  minor x tick num=3,
  title={Comparison to sota},
]

\draw[treatment line] ([yshift=-2pt] axis cs:2.0875, 0) |- (axis cs:1.5875, -2.0)
  node[treatment label, anchor=east] {e2e_ensemble};
\draw[treatment line] ([yshift=-2pt] axis cs:2.45, 0) |- (axis cs:1.5875, -3.0)
  node[treatment label, anchor=east] {e2e_weighted_ensemble};
\draw[treatment line] ([yshift=-2pt] axis cs:3.275, 0) |- (axis cs:1.5875, -4.0)
  node[treatment label, anchor=east] {deepar};
\draw[treatment line] ([yshift=-2pt] axis cs:3.3, 0) |- (axis cs:5.6, -4.0)
  node[treatment label, anchor=west] {e2e_roc_selection};
\draw[treatment line] ([yshift=-2pt] axis cs:4.7875, 0) |- (axis cs:5.6, -3.0)
  node[treatment label, anchor=west] {Ens};
\draw[treatment line] ([yshift=-2pt] axis cs:5.1, 0) |- (axis cs:5.6, -2.0)
  node[treatment label, anchor=west] {OEP-ROC-ST-redo};
\draw[group line] (axis cs:3.275, -2.6666666666666665) -- (axis cs:3.275, -2.6666666666666665);
\draw[group line] (axis cs:2.0875, -1.3333333333333333) -- (axis cs:2.0875, -1.3333333333333333);
\draw[group line] (axis cs:3.3, -2.6666666666666665) -- (axis cs:3.3, -2.6666666666666665);
\draw[group line] (axis cs:2.45, -2.0) -- (axis cs:2.45, -2.0);
\draw[group line] (axis cs:5.1, -1.3333333333333333) -- (axis cs:5.1, -1.3333333333333333);
\draw[group line] (axis cs:4.7875, -2.0) -- (axis cs:4.7875, -2.0);

\end{axis}

\end{tikzpicture}
mirkobunse commented 1 year ago

Thanks for reporting!

pip install --upgrade 'critdd @ git+https://github.com/mirkobunse/critdd'

This issue is resolved by the latest commit 8c062a6, to which the package is upgraded through the command above. Let me know if any problem remains.

By the way, if you stumble across underscore problems elsewhere (EDIT: or, if you do not want to re-produce the LaTeX source of your plot), you can use the underscore LaTeX package:

\usepackage{underscore}