# Plotting a distribution

**URL:** https://discourse.julialang.org/t/plotting-a-distribution/25356
**Category:** Statistics
**Created:** [June 17, 2019, 6:17am UTC](https://discourse.julialang.org/t/plotting-a-distribution/25356 "2019-06-17T06:17:38Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [June 17, 2019, 6:33am UTC](https://discourse.julialang.org/t/plotting-a-distribution/25356/3 "2019-06-17T06:33:28Z")

</div>

Please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).

It is unclear _what_ you want to plot for a distribution. The pdf, the cdf, or something else? In any case, here is a PGFPlotsX example:

```julia
using PGFPlotsX, Distributions

d = Normal(100.3434334, 0.05)
lo, hi = quantile.(d, [0.01, 0.99])
x = range(lo, hi; length = 100)
@pgf Axis({ xlabel = "x", ylabel = "pdf" },
          Plot({thick, blue }, Table(x, pdf.(d, x))))
@pgf Axis({ xlabel = "x", ylabel = "cdf" },
          Plot({thick, blue }, Table(x, cdf.(d, x))))

```

 ![1](https://global.discourse-cdn.com/julialang/original/3X/6/6/66302b59835bc97f073b71897840d4f58eca8ca3.png)

 ![2](https://global.discourse-cdn.com/julialang/original/3X/8/b/8b8842894951d8e01ad0b7a55c3b4cb597c35bfc.png)

---

_[View the full topic](https://discourse.julialang.org/t/plotting-a-distribution/25356)._
