TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a graph, where the labels for the tikz mark are not supposed to be numbers but strings, is there a(n easy) way to achieve this with tikz-datavisualisation?

Mockup of what I am going for: enter image description here

Notice that the tikz are labeled with names. A further issue I don"t know how to fix is how to set marks ONLY where I supply data.

Exampledata I supply:

alpha 2 3
hotel 3 6
uniform 1 7

What I have so far:

\usepackage[utf8]{inputenc}                     %input encoding
{}{}{#1 #2 #3}
    \pgfkeys{/data point/.cd, x=#1, y=#2, set=1} \pgfdatapoint
    \pgfkeys{/data point/.cd, x=#1, y=#3, set=2} \pgfdatapoint

\datavisualization [scientific axes=clean, %y axis=grid,
style sheet=vary dashing,
visualize as line/.list={1,2}]
data[format=cacheConfigs] {
1 2 3
2 3 6
3 1 7
share|improve this question
Could you edit your question to provide a minimal example document that shows how you want to provide the data? – Jake Jun 20 '13 at 23:34
@Jake: I hope the picture/mwe helps if there is anything else to make the question clearer let me know – ted Jun 21 '13 at 9:45
up vote 1 down vote accepted

Alright, here's one way to do this: We can store the labels in a list macro and assign the data points an x value based on a simple counter. For printing the labels, we then pick out the corresponding list entry for a given x position. To have only tick marks where we also have data, you can set x axis={ticks={step=1}}



{} % No catcode changes
{\@tempcnta=1 \xdef\label@list{}} % Initialise count and label list
{#1 #2 #3}  % Argument format
    \xdef\label@list{\label@list,"#1"}  % Append label to list
    \pgfkeys{/data point/.cd, x=\the\@tempcnta, y=#2, set=1} \pgfdatapoint  % Store data point, with count as x
    \pgfkeys{/data point/.cd, x=\the\@tempcnta, y=#3, set=2} \pgfdatapoint
    \advance\@tempcnta 1\relax  % Step the count

\datavisualization [
    scientific axes=clean,
    style sheet=vary dashing,
    visualize as line/.list={1,2},
    x axis={
            tick typesetter/.code=\ticksfromlabellist{##1},
            style={text height=1ex} % For proper vertical alignment
] data [format=cacheConfigs] {
a 2 3
b 3 6
c 1 7

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.