Hi,

I have some questions on the layout of bar plots (xbar) I couldn't
find a solution so far. Below follows a minimal working example
(MWE). I have many data to plot which is why I'm looking for
automated solutions.

1. How can I use comma in “symbolic y coords”? (second plot MWE:
“Waschen, Reinigen” instead of “Waschen/Reinigen”)

2. Can “symbolic y coords” automatically be filled with the content
of a table row?

3. I do not understand how “text width” in “yticklabel style” works.
Increasing it shifts the whole plot to the right but it does not
seem to increase the text width for the labels; at least there's a
lot of white space on the left of the plot while there's enough text
to fill the white space.

4. How can I automatically adjust vertical spacing? Both plots in
the MWE have the same height and width. But the second plot needed
more space.---JFTR: I already asked a similar question here:
http://tex.stackexchange.com/questions/84073/space-between-bars-height-and-width-of-the-plot

%Minimal working example: --->
\documentclass{article}
\usepackage{%
  pgfplots%
  ,filecontents%
  ,fontspec%
}
\usepackage[ngerman]{babel}

\begin{document}

\begin{filecontents}{drei-balken.dat}
6, zu groß
59, genau passend
3, zu klein
\end{filecontents}
\begin{tikzpicture}
  \begin{axis}[%
    xbar, %
    symbolic y coords={zu groß,genau passend,zu klein},%
    ytick=data,%
    nodes near coords,%
    nodes near coords align={horizontal},%
    ]
    \addplot table[col sep=comma,header=false] {drei-balken.dat};
  \end{axis}
\end{tikzpicture}

\begin{filecontents}{vierzehn-balken.dat}
57, Waschen/Reinigen
50, Obst abholen
47, Verteilen
44, Zerkleinern
43, Abfall entsorgen
38, Schälen
38, Arbeitsgeräte säubern
5, Sonstiges
2, Tisch decken
1, Waschen u. Zurückbringen d. Container
1, Mit zunehmendem Alter übernehmen die Kinder immer mehr
Arbeitsschritte
1, Keine
1, Geschirr + Besteck holen
1, Dekoratives Anrichten
\end{filecontents}
\begin{tikzpicture}
  \begin{axis}[%
    xbar, %
    symbolic y coords={%
      Waschen/Reinigen,%
      Obst abholen,%
      Verteilen,%
      Zerkleinern,%
      Abfall entsorgen,%
      Schälen,%
      Arbeitsgeräte säubern,%
      Sonstiges,%
      Tisch decken,%
      Waschen u. Zurückbringen d. Container,%
      Mit zunehmendem Alter übernehmen die Kinder immer mehr
Arbeitsschritte,%
      Keine,%
      Geschirr + Besteck holen,%
      Dekoratives Anrichten,%
    },%
    ytick=data,%
    yticklabel style={text width=7cm,align=right},%
    nodes near coords,%
    nodes near coords align={horizontal},%
%    y post scale=2.2 % schlechter Workaround, um die
                      % Balken auseinanderzuziehen
                      % bzw. auszurichten
    ]
    \addplot table[col sep=comma,header=false] {vierzehn-balken.dat};
  \end{axis}
\end{tikzpicture}

\noindent x \hfill{} x
\end{document}
%<---

I use TL 2012 with lualatex.

Best Regards
Christoph
-- 
(La)TeX-FAQ: http://projekte.dante.de/DanteFAQ +++ Minimalbeispiel
erstellen und Einführung in dctt: http://www.latex-einfuehrung.de/
+++ Veraltete Befehle, Pakete und andere Fehler:
ftp://ftp.dante.de/tex-archive/info/l2tabu/german/l2tabu.pdf
+++ Typografie-Regeln (1.7): http://bit.ly/typokurz-cb


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to