pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
200 stars 35 forks source link

[symbolic coords] in combination with `bar width` doesn't work #147

Open pgf-tikz-bot opened 7 years ago

pgf-tikz-bot commented 7 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/147/ Author: mo-gul Timestamp: 2017-01-09 14:12:47.193000

As was reported at http://tex.stackexchange.com/q/347831/95441 bar width isn't working when symbolic coords are used. Here a more reduced MWE

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
    \pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ybar,
%    % leads to an error suggesting to use `[normalized]' ...
%    bar width={1},
    % but using it results in a math error that "normlaized" isn't a known
    % math function (of course)
    bar width={[normalized]1},
    symbolic x coords={a,b},
]
\addplot coordinates {
    (a, 39.000000)
    (b, 30.200000)
};
\end{axis}
\end{tikzpicture}
\end{document}
pgf-tikz-bot commented 7 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/147/#b1b9 Author: mo-gul Timestamp: 2017-01-25 05:37:13.319000

In the meantime Symbol 1 proposed a solution to that problem. Hopefully you can directly adopt it into the repository.