# Heat map from vector of ints and count

**URL:** <https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717>\
**Category:** Kibana\
**Created:** [October 30, 2018, 7:23pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717 "2018-10-30T19:23:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_CC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_cc/32/47241_2.png) [@Mike\_CC](https://discuss.elastic.co/u/Mike_CC)\
**Post date:** [October 30, 2018, 7:23pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/1 "2018-10-30T19:23:33Z")

</div>

Hi,

I have a variable that consists of vector of integers and I would like to plot a heat map with the count of each element, ideally I would like these to be grouped within bins of variable sizes, due to the fact that there is no limit on the range of the values. I can simply split up the vector modifying the logstash filter but my problem doesn't change.

A simplified view of the input data could be the following:

```
            doc1 doc2 doc3 doc4 doc5 doc6
 vec[0] 1 1 2 2 2 1
 vec[1] 2 2 2 2 2 2
 vec[2] 2 3 3 2 2 3
 vec[3] 3 3 4 4 3 4
 vec[4] 3 2 2 3 5 5
 vec[5] 4 4 5 5 3 2

```

And what I would like to achieve is something like this:

```
    1 2 3 4 5 (value)
0 3 3 0 0 0 
1 0 6 0 0 0  
2 0 3 3 0 0 
3 0 0 3 3 0   
4 0 2 2 0 2 
5 0 1 1 2 2
(idx)

```

Any help would be appreaciated.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 30, 2018, 9:08pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/2 "2018-10-30T21:08:48Z")

</div>

Hey @Mike_CC, I'm having a hard time understanding how your inputs are correlated to your expected output, are you wanting to perform vector or matrix operations on the inputs?

---

<div class="post-metadata">

**Author:** ![Mike\_CC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_cc/32/47241_2.png) [@Mike\_CC](https://discuss.elastic.co/u/Mike_CC)\
**Post date:** [October 31, 2018, 7:30am UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/3 "2018-10-31T07:30:20Z")

</div>

Hi @Brandon_Kobel, in my example the vector has 6 indexes and possible values from 1 to 5. What I want to achieve is the count of each value (1 -5) for each index of the vector. If we look at the first index, i.e. vec[0], we have 3 times value 1 and 3 times value 2 so the out put vector for idx 0 is [3,3,0,0,0].

I hope I explained myself better this time.

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 31, 2018, 2:59pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/4 "2018-10-31T14:59:32Z")

</div>

Hey @Mike_CC, I can't think of a way in which you could create this chart using the built-in Heatmap visualization. Have you tried looking at [Vega](https://www.elastic.co/guide/en/kibana/current/vega-graph.html) to do this?

---

<div class="post-metadata">

**Author:** ![Mike\_CC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_cc/32/47241_2.png) [@Mike\_CC](https://discuss.elastic.co/u/Mike_CC)\
**Post date:** [October 31, 2018, 4:19pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/5 "2018-10-31T16:19:50Z")

</div>

Hi again @Brandon_Kobel, I've "discovered" Vega today, I've been looking in to it, if I get something useful I'll post it. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 28, 2018, 4:19pm UTC](https://discuss.elastic.co/t/heat-map-from-vector-of-ints-and-count/154717/6 "2018-11-28T16:19:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
