# Why are the symbolic (textual) coordinates misaligned in my pgfplots plot? [duplicate]

I am creating a plot with pgfplots and using symbolic (textual) input coordinates. My MWE is as follows:

\providecommand{\myrootdir}{..}
\documentclass[tikz]{standalone}
\onlyifstandalone{
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=80mm,height=50mm,
xtick=data,
symbolic x coords={yellow, green, blue}]

coordinates {(yellow, 2) (green, 1) (blue, 3)};
coordinates {(yellow, 2.5) (green, 2) (blue, 3)};
coordinates {(yellow, 3) (green, 3) (blue, 1)};

\end{axis}
\end{tikzpicture}
\end{document}


This produces the following plot:

As you can see in the image, the input coordinate "green" is misaligned (too high). How can I fix this?

The input coordinate labels seem to get misaligned as the text is moved as close to the x axis as possible, disregarding the other labels.

As "green" does not contain any "high" letter, such as "l" in "yellow" and "b" or "l" in "blue", it can be moved closer to the axis.

To solve this, I used the workaround of capitalising all labels. Another possibility would be to reword the labels, if possible.

I am looking forward to a better solution, but I posted this question to be able to show one option for solving it that I used in my document. I hope it is helpful to some!

• add text height=2ex to yticklabel style – percusse May 17 '18 at 15:57
• Do you mean the xticklabel? Either way, neither seem to work. :/ – vauhochzett May 17 '18 at 16:00
• xticklabel style={text height=3ex} works for me \ – percusse May 17 '18 at 16:02
• I closed this question as a duplicate. Have a look there how to solve this "problem". – Stefan Pinnow May 17 '18 at 16:03
• If the question and/or the answer(s) are useful, feel free to upvote there ... – Stefan Pinnow May 18 '18 at 20:05