-1

I approximately learn how we can plot a histogram by help of here manual. But I do not know how can I plot a histogram as a collection of brickbats as below shape:

brickbat histogram

1 Answers1

3

I think you need more than this, but you did not show it:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth]
\draw[<-] (6,0) node[below] {?} -- (-.5,0);
\draw[->] (0,-.5) -- (0,5) node[left] {$y$};
\draw (0,0) grid (5,1) (2,1) grid (3,4) (4,1) rectangle (5,2);
\end{tikzpicture}
\end{document}

enter image description here

  • Thanks so much. I am learning how can I generalize that. I have problem with "\draw (0,0) grid (5,1) (2,1) grid (3,4) (4,1) rectangle (5,2)" but I am thinking about their parameters – Irreversible Apr 04 '19 at 14:12
  • @Irreversible They are simply coordinates, nothing more. What is your problem? –  Apr 04 '19 at 14:13
  • You are right. When two pairs brought together same as (3,4) (4,1) I could not understand the mean of that. Right now I can understand. They are separated. "(2,1) grid (3,4)" are related to each other and "(0,0) grid (5,1)" also with each other. – Irreversible Apr 04 '19 at 14:20