Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with bar charts #1

Open
jdugge opened this issue Sep 2, 2014 · 1 comment
Open

Doesn't work with bar charts #1

jdugge opened this issue Sep 2, 2014 · 1 comment

Comments

@jdugge
Copy link

jdugge commented Sep 2, 2014

Great work on the library!

Feature request: Add cycle lists that work for bar plots (i.e. fill the bars), similar to the predefined standard bar cycle list

/pgfplots/bar cycle list/.style={/pgfplots/cycle list={%
    {blue,fill=blue!30!white,mark=none},%
    {red,fill=red!30!white,mark=none},%
    {brown!60!black,fill=brown!30!white,mark=none},%
    {black,fill=gray,mark=none},%
    {violet!80!black,fill=violet,mark=none},%
    {green,fill=green!80!black,mark=none}%
    }
}

Admittedly, doing this would mean being holier than the pope, since the built-in cycle lists like exotic and black white don't work for bar plots either. It would still be nice to have, though, since bar plots are a pretty common plot type that really profits from having a proper categorical colour scheme.


Test case:

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{colorbrewer}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ybar,
    samples=3,
    cycle list name=Set1-3
]
\addplot {rnd};
\addplot {rnd};
\addplot {rnd};
\end{axis}
\end{tikzpicture}
\end{document}

screenshot from 2014-09-02 20 13 50

@vtraag
Copy link
Owner

vtraag commented Sep 4, 2014

Yes, good idea. I also already added a style for when using actual markers (similar issues appear there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants