# How to plot correlation matrix data as heat map in kibana?

**URL:** <https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471>\
**Category:** Kibana\
**Created:** [August 11, 2020, 12:34am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471 "2020-08-11T00:34:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apremgeorge](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@apremgeorge](https://discuss.elastic.co/u/apremgeorge)\
**Post date:** [August 11, 2020, 12:34am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471/1 "2020-08-11T00:34:01Z")

</div>

Hi,  
I have uploaded a correlation matrix data from python into kibana,  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c57577b4d2bf96045c68db621c99f9560a90e885.png)  
Total 55 records, each "\_id" has 55 records

Even i can view as

```auto
GET atmodelleddata.cm_v1/_search
{
  "aggs": {
    "statistics": {
      "matrix_stats": {
        "fields": ["field1", "field2","field3",....."field55"]
      }
    }
  }
}

```

May i know to plot that as heat map in visualization  
Thanks

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [August 13, 2020, 7:54am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471/2 "2020-08-13T07:54:21Z")

</div>

Hi @apremgeorge,

take a look at this example, maybe you'll find it helpful: [Vega heatmap chart for matrix stats (correlation)](https://discuss.elastic.co/t/vega-heatmap-chart-for-matrix-stats-correlation/226099)

---

<div class="post-metadata">

**Author:** ![apremgeorge](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@apremgeorge](https://discuss.elastic.co/u/apremgeorge)\
**Post date:** [August 14, 2020, 12:50am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471/3 "2020-08-14T00:50:59Z")

</div>

Thank you very much @Marta_Bondyra

---

<div class="post-metadata">

**Author:** ![apremgeorge](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@apremgeorge](https://discuss.elastic.co/u/apremgeorge)\
**Post date:** [August 14, 2020, 4:57am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471/4 "2020-08-14T04:57:56Z")

</div>

@ [Vincent\_Maury](https://discuss.elastic.co/u/Vincent_Maury)  
@ Marta\_Bondyra

I am using v3 "[https://vega.github.io/schema/vega/v3.json](https://vega.github.io/schema/vega/v3.json)",  
I have two issues with that  
I can't rotate the x-axis label name

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4ba27615687762388dbca2da1b60fd91bf6eb19.png)  
and  
I can't make the legend to vertical  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/6735fa860007e49d8765b468f57ec389ee39072b.png)

Looking after like this  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/4/140d0a6010ddbcc9917eb2fd6344834d897c89a7.png)  
and

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/e/ce84b974b06ee2cae81f879b717eafdde66d000d.png)

I tried as

```auto
  "axes": [
      {
        "orient": "bottom", 
        "scale": "x", 
        "labelAngle": -45,
        "tickOffset": 0,
        "labelAlign": "right",
        "domain": false,
        "title": "Features"
      },
      {
        "orient": "left", 
        "scale": "y", 
        "domain": false,
        "title": "Features"
      }
  ],
  "legends": [
    {
      "orient": "right", 
      "direction" : "vertical",
      "fill": "color",
      "type": "gradient",
      "title": "Correlation",
      "titleFontSize": 12,
      "titlePadding": 4,
      "gradientLength": {"signal": "height - 16"}
    }
  ],

```

My Full plot

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/e/0e982f5484bd925c76e663b69908f04c1b68d616.png)

May i have some help please, Thanks

---

<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:** [September 11, 2020, 4:58am UTC](https://discuss.elastic.co/t/how-to-plot-correlation-matrix-data-as-heat-map-in-kibana/244471/5 "2020-09-11T04:58:12Z")

</div>

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