I have a csv file like:
column1,column2
string1,value1
string2,value2
…
Values are integers, strings are alphanumeric.
I tried to plot it, with strings on x axis and values on y axis. After some tries leading to errors like Could not parse input "string1" as a floating point number, sorry. The unreadable part was near…, based on some questions (like here, here, here, here or here), i finally found this only way to get the things works, (see also the doc, page 363):
\begin{tikzpicture}
\begin{axis}[
symbolic x coords={string1,string2,string3,…},
minor tick num=1,
]
\addplot table [x=column1,y=column2] {csvfile.csv}
\end{axis}
\end{tikzpicture}
Obviously, the non-numerical data needs to be write directly in the graph definition.
How can i have the same in a DRY way, i.e. have for only source of data the CSV file given as \addplot parameter ?