# Heatmap Plots.jl

**URL:** https://discourse.julialang.org/t/heatmap-plots-jl/39406
**Category:** General Usage
**Tags:** plotting
**Created:** [May 13, 2020, 2:05pm UTC](https://discourse.julialang.org/t/heatmap-plots-jl/39406 "2020-05-13T14:05:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kruxigt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kruxigt/32/11694_2.png) [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)
#### Post date: [May 13, 2020, 2:05pm UTC](https://discourse.julialang.org/t/heatmap-plots-jl/39406/1 "2020-05-13T14:05:38Z")

</div>

Good afternoon!

I can not get the heatmap plot in the Plots.jl package to do what I would like.

If I do:

```julia
using Plots
backend(:plotly)
p = heatmap([1,2,3,1,2,3,1,2,3],[1,1,1,2,2,2,3,3,3],[1,1,1,1,1,1,1,1,1])
gui(p)

```

I get the result:  
 ![newplot](https://global.discourse-cdn.com/julialang/original/3X/0/f/0ffa17416c6033e5f8c5e218ce6fc66234996830.png)

while I expect some kind of plot homogeneously filled with ones. (maybe from 0,5 to 3,5 in x and y?)

What am I missing?

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [May 13, 2020, 2:21pm UTC](https://discourse.julialang.org/t/heatmap-plots-jl/39406/2 "2020-05-13T14:21:38Z")

</div>

heatmap plots a heatmap of a rectangular matrix z, which is your

```julia
[1,1,1,1,1,1,1,1,1]

```

despite that this isn’t a rectengular matrix.

Try first

```julia
heatmap([1 1 1;1 1 1;1 1 1])

```

which results in your expectation.  
Or to have it more visually appealing:

```julia
heatmap([1 2 3;3 2 1;2 3 1])

```

To provide x and y labels you use x and y vectors of strings

```julia
heatmap(["1","2","3"],["1","2","3"],[1 2 3;2 3 1;3 1 1])

```

See examples in the docs:  
[http://docs.juliaplots.org/latest/generated/plotly/#plotly-ref28-1](http://docs.juliaplots.org/latest/generated/plotly/#plotly-ref28-1)

---

<div class="post-metadata">

### Author: ![Kruxigt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kruxigt/32/11694_2.png) [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)
#### Post date: [May 13, 2020, 2:31pm UTC](https://discourse.julialang.org/t/heatmap-plots-jl/39406/3 "2020-05-13T14:31:49Z")

</div>

Thank you so much for a great answer! That solved my problems!

> [@oheil](#):
>
> To provide x and y labels you use x and y vectors of strings
> 
> ```julia-auto
> heatmap(["1","2","3"],["1","2","3"],[1 2 3;2 3 1;3 1 1])
> 
> ```

Actually it seems that you can provide it with integers instead of strings for “categories” and it will be smart enough to handle that too.
