# Plot the Histogram of given data (txt. file with 3 columns)

**URL:** <https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621>\
**Category:** Statistics\
**Tags:** question\
**Created:** [November 2, 2019, 12:48pm UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621 "2019-11-02T12:48:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haider17233](https://avatars.discourse-cdn.com/v4/letter/h/0ea827/32.png) [@Haider17233](https://discourse.julialang.org/u/Haider17233)\
**Post date:** [November 2, 2019, 12:48pm UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/1 "2019-11-02T12:48:22Z")

</div>

Histogram of the absolute frequencies (use classes of width 0.5°C) and additional plot with the histogram of the relative frequencies.

Please plot the relative frequencies of the temperatures in the month October over the given period (Now class width 1°C).

Please help me to plot these two lots. Thank you so much  
**My txt. file looks like as below:**  
**#% TIME\_BEGIN TIME\_END TEMPERATURE**  
**19570901 19570930 13.2**  
**19571001 19571031 10.4**  
**19571101 19571130 6.2**  
**19571201 19571231 2.3**  
**19580101 19580131 2.1**  
**19580201 19580228 4.5…**

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 2, 2019, 1:12pm UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/2 "2019-11-02T13:12:32Z")

</div>

Is this a homework problem?

Consider using the following ingredients:

1. [DelimitedFiles](https://docs.julialang.org/en/latest/stdlib/DelimitedFiles/), or one of the CSV libraries (with a space delimited) to read the data,
2. parse the dates using [Dates](https://docs.julialang.org/en/latest/stdlib/Dates/),
3. make a histogram with [`StatsBase.Histogram`](https://juliastats.org/StatsBase.jl/latest/empirical/#Histograms-1),
4. plot using your favorite plotting library.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [November 2, 2019, 6:19pm UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/3 "2019-11-02T18:19:14Z")

</div>

You’re new to… MATLAB?

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [November 2, 2019, 8:04pm UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/4 "2019-11-02T20:04:14Z")

</div>

Hahaha…

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [November 3, 2019, 2:47am UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/5 "2019-11-03T02:47:21Z")

</div>

I used to be a matlabhead. It’s like being a motorhead except the people are obsess with matlab instead of automobiles.

---

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [November 3, 2019, 8:51am UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621/6 "2019-11-03T08:51:09Z")

</div>

Hi @Haider17233. Welcome to the Julia forum.

Julia is a very different programming language from Matlab, even if the syntax is somewhat similar. If you have been assigned a homework problem in Matlab, then you should probably stick to Matlab, or use [Octave](https://www.gnu.org/software/octave/), which is an open-source implementation of essentially the same language.

On the other hand, if you have the option of using either Matlab or Julia, then I think many people here would argue that Julia is the better choice, and are willing to help you get started.
