# How to put two histograms in one plot?

**URL:** https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265
**Category:** Kibana
**Created:** [October 5, 2018, 5:51pm UTC](https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265 "2018-10-05T17:51:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [October 5, 2018, 5:51pm UTC](https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265/1 "2018-10-05T17:51:21Z")

</div>

I would like to put two histogram with similar topic in one plot for comparison. But I could not find how to do it. May I know how to do that?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)
#### Post date: [October 5, 2018, 7:17pm UTC](https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265/2 "2018-10-05T19:17:53Z")

</div>

Hello Vernal,

You might find the thread below useful! Depending on your specific use case, Vega (still experimental) might be a good fit.

> [@Multiple visualization in same chart in Kibana](https://discuss.elastic.co/t/multiple-visualization-in-same-chart-in-kibana/106271):
>
> Is it possible to create multiple visualization in a single chart ? i want to implement a graph like below. any ideas or explanations are welcome. [image] x-axis contains the service name and the y-axis contains the count. Bar chart represents Success and the Line chart represents Failure

Regards,  
Aaron

---

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [October 5, 2018, 9:54pm UTC](https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265/3 "2018-10-05T21:54:28Z")

</div>

Hi Aaron,

I tried Vega before. But even for one histogram, it does not work at all. I have tried about one week, but it still cannot work, which made me really frustrated. Could you help take a look what is wrong with my code? Or maybe this is caused by bugs in Kibana, not in my code?Thanks a lot!

{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.json](https://vega.github.io/schema/vega-lite/v2.json)",  
"data": {  
"url": {  
"%context%": "true",  
"index": "ge3\_core\_stats\*",  
"body":{  
"size": 10000,  
"\_source":["avg\_volt"]  
}  
}  
"format": {"property":"hits.hits"}  
},  
"mark": "bar",  
"encoding": {  
"x": {  
"bin": "binned",  
"field": "\_source.avg\_volt",  
"type": "quantitative"  
},  
"y": {  
"aggregate": "count",  
"type": "quantitative"  
}  
}  
}

---

<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 2, 2018, 9:54pm UTC](https://discuss.elastic.co/t/how-to-put-two-histograms-in-one-plot/151265/4 "2018-11-02T21:54:29Z")

</div>

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