In the legend of a pgfplot, the text is on the right of the image. Is it possible to move the text to the left of the image for a single entry?
For example, the following LaTeX code will produce a legend that reads
[░░] Bad [▒▒] [██] Good
Instead, I would like to move "Bad" to the left of the legend image and get
Bad [░░] [▒▒] [██] Good
Is there a way to accomplish this with pgfplots?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots, pgfplotstable}
\pgfplotsset{compat=1.17}
\begin{document}
\pgfplotstableread[col sep=&]{
Q & A & B & C
Q1 & 0 & 1 & 3
Q2 & 2 & 1 & 1
}{\answers}
\begin{tikzpicture}
\begin{axis}[
legend columns=-1,
legend to name=leg1,
xbar stacked,
y=0.8cm, y dir=reverse, xmin=0, xmax=4,
ytick=data, yticklabels from table={\answers}{Q},
]
\addplot [fill=red] table [x=A, y expr=\coordindex] {\answers};
\addplot [fill=yellow] table [x=B, y expr=\coordindex] {\answers};
\addplot [fill=green] table [x=C, y expr=\coordindex] {\answers};
\legend{Bad, { },Good}
\end{axis}
\end{tikzpicture}
\ref{leg1}
\end{document}
