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

Is it possible to fill “symbolic y coords” automatically with the content of a table row? I have many data to plot and it would be very cumbersome and laborious to do it manually.

Best regards


share|improve this question
I wouldn't use symbolic coordinates in this case, but x expr=\coordindex in combination with xtick=data, xticklabels from table={<table macro>}{<column with labels>}. – Jake Nov 25 '12 at 21:19
up vote 5 down vote accepted

I wouldn't use symbolic coordinates for something like this, because they're much less comfortable to use than "proper" coordinates. You can simply plot the data using x expr=\coordindex and add the labels from the table using xtick=data, xticklabels from table={<table macro>}{<column with labels>}:

\usepackage{pgfplots, pgfplotstable}

\pgfplotstableread[col sep=comma, header=false]{
      23, Einhaltung der Hygienestandards
      20, Zeitintensität des Programms
      18, Zubereitung des O+G
      16, Lagerung des O+G
      7, Müllentsorgung und Reinigung
      6, Sonstige
      4, Keine Probleme
      4, Abstimmung mit dem Lieferanten/Warennahme/Lieferzeitpunkt
      1, Verteilung des O+G auf die Klassen
      1, Qualität der Lieferung/Lieferung an zwei aufeinanderfolgenden Tagen ist schlecht/bessere Verteilung
      1, Keine Lieferung an allen Schultagen/nach Ferien öfters holpriger Beginn
      1, Auswahl des Obstes
      1, Ausstattung mit Materialien (Schneidebrett)
      1, Anmeldung zum SOP

    xbar, %
    bar width=0.5cm,%
    enlarge y limits={abs=0.45cm},
    yticklabels from table={\datatable}{1},
    yticklabel style={text width=5cm,align=right},%
    nodes near coords,%
    nodes near coords align={horizontal},%
    \addplot table [y expr=\coordindex, x=0] {\datatable};
share|improve this answer
Thank you very much! That solved my problem! – typokurz Nov 27 '12 at 15:14

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.