Für alle, die ein ähnliches Problem habe. Ich habe eine wunderbare Lösung vom Autor des packages bekommen:
Code:
\documentclass[a4paper]{article}
\usepackage{pgfplots}
\begin{document}
% Task: symbolic coordinates which can be formatted somehow.
%
% Problem: coordinates must be expandable (i.e. no formatting
% instructions allowed).
%
% Suggested approach: define a dictionary which is only used for tick
% labels:
\expandafter\newcommand\csname dict.a\endcsname{$\alpha$}
\expandafter\newcommand\csname dict.b\endcsname{$\beta$}
\expandafter\newcommand\csname dict.c\endcsname{$\xi$}
% Explanation:
% \expandafter replaces the *second* following token by its
% "top-level" expansion:
% \expandafter\newcommand\csname dicta\endcsname{...}
% -->
% \newcommand\dicta{...}
%
% \csname ...\endcsname is, in principle, the same as '\...'. But you
% can use any characters inside of '...', including commands.
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={a,b,c},xticklabel=\csname dict.\tick\endcsname,
xtick=data,
]
\addplot coordinates {(a,2) (b,3) (c,4)};
\end{axis}
\end{tikzpicture}
\end{document}
Lesezeichen