# Multivariate normal distribution?

**URL:** <https://discourse.julialang.org/t/multivariate-normal-distribution/107560>\
**Category:** New to Julia\
**Tags:** question, plotting\
**Created:** [December 13, 2023, 11:02am UTC](https://discourse.julialang.org/t/multivariate-normal-distribution/107560 "2023-12-13T11:02:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![disaster](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@disaster](https://discourse.julialang.org/u/disaster)\
**Post date:** [December 13, 2023, 11:02am UTC](https://discourse.julialang.org/t/multivariate-normal-distribution/107560/1 "2023-12-13T11:02:42Z")

</div>

Hello, i’m new to Julia and have to plot a multivariate normal distribution. If i use MvNormal and try to plot it like plot(x\_values,MvNormal) I get the Error Cannot convert FullNormal to series data for plotting stacktrace.  
Can somebody tell me what i’m doing wrong ?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 13, 2023, 12:00pm UTC](https://discourse.julialang.org/t/multivariate-normal-distribution/107560/2 "2023-12-13T12:00:50Z")

</div>

What do you want to plot? The pdf? What plotting package are you using?

---

<div class="post-metadata">

**Author:** ![disaster](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@disaster](https://discourse.julialang.org/u/disaster)\
**Post date:** [December 13, 2023, 12:17pm UTC](https://discourse.julialang.org/t/multivariate-normal-distribution/107560/3 "2023-12-13T12:17:44Z")

</div>

Sorry i found out the topic is already solved.

> [@How to plot a multivariate normal distribution?](https://discourse.julialang.org/t/how-to-plot-a-multivariate-normal-distribution/35486/7):
>
> Just a warning/note about x-y ordering when creating the Z grid: if you’re plotting as a contour/heatmap, then you’ll want to reverse the for x in X, y in Y ordering to be for y in Y, x in X so that the grid maps to the x-y axes correctly. This is subtle, as it will not always present itself as a problem depending on the parameters of the MvNormal. Here’s an example plotting a bivariate normal distribution as filled contours: using Distributions using Plots μ = [0, 0] Σ = [1 0.9; 0.9 10…

Have a nice day.

---

<div class="post-metadata">

**Author:** ![John\_Gibson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_gibson/32/5321_2.png) [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Post date:** [December 13, 2023, 12:32pm UTC](https://discourse.julialang.org/t/multivariate-normal-distribution/107560/4 "2023-12-13T12:32:39Z")

</div>

Can you post a minimum working example? I.e. the complete sequence of code that triggers the error, including the initialization of all variables and the loading of packages.

Use backticks to format code blocks within discourse. Typing this text

````julia
```julia
function f(x, y)
    x + y
end
```

````

displays as

```julia
function f(x, y)
    x + y
end

```

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …
