2

I am trying to follow this answer for drawing a historgram. I was able to change the fill color of the histogram but I was not able to change the line color of the bars.

Question: What do I have to modify to have black outlines for the bars.

Just for reference (this is the code provided by @Jake)

\documentclass[border=5mm]{standalone}
\usepackage{filecontents}
\usepackage{pgfplots, pgfplotstable}
\usepgfplotslibrary{statistics}

\begin{filecontents}{data.csv}
dist
1
2
2.5
2
1
3.5
3
1
3
2
1
1
0.5
1
1.5
1
\end{filecontents}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ybar,
    ymin=0
]
\addplot +[
    hist={
        bins=7,
        data min=0.5,
        data max=4
    }   
] table [y index=0] {data.csv};
\end{axis}
\end{tikzpicture}
\end{document}

1 Answer 1

2

Add draw=black to the \addplot options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .