Hi Gennaro,
welcome to the forum!
With symbolic coordinates, a question may be, what is the x range, the y range, the placement. It may be undefined here, what may explain that labels are randomly chosen. Interesting anyway. What is missing though, is
ytick=data
and
ytick=data
.
But here is a working solution for you. I take normal coordinates, but symbolic labels, that gives a good picture and using these coordinates you can eve choose fine positions for labels or between symbolic values.
Code: Select all
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel = {$x$},
ylabel = {$y$},
xmin = 0,
xmax = 5.5,
ymin = 0,
ymax = 5.5,
domain = -1:5
y domain = -1:5,
axis lines = center,
xtick = { 1,2,3,4,5 },
ytick = { 1,2,3,4,5 },
xticklabels = { $x_1$, $x_2$, $x_3$, $x_4$, $x_5$ },
yticklabels = { $C(x_1)$, $C(x_2)$, $C(x_3)$,
$C(x_4)$, $C(x_5)$ }
]
\end{axis}
\end{tikzpicture}
\end{document}

- plot.png (11.31 KiB) Viewed 3910 times
Stefan