# Turn off "KDE plot failed" from traceplot

**URL:** <https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878>\
**Category:** Questions\
**Created:** [March 8, 2019, 9:33pm UTC](https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878 "2019-03-08T21:33:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chartl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/chartl/32/1515_2.png) [@chartl](https://discourse.pymc.io/u/chartl)\
**Post date:** [March 8, 2019, 9:33pm UTC](https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878/1 "2019-03-08T21:33:24Z")

</div>

When (vector-valued) posterior distributions contain entries which are constrained (e.g. off-diagonal components of a diagonal matrix), and thus have no standard deviation,  
`pm.traceplot` can generate an ugly warning box that one or more of the variables wasn’t actually plotted:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/1/1d14c69cb79d3c59956d9bb52b79926dc9692885.jpeg)

But just because one component failed to plot doesn’t mean I’m not interested in what the others look like. Is there a way to turn this feature off?

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [March 9, 2019, 6:44am UTC](https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878/2 "2019-03-09T06:44:47Z")

</div>

We recently switched to arviz for plotting, which means it will now plot each dimension of every RV individually. Currently, you cannot plot everything today in one plot: [https://github.com/arviz-devs/arviz/issues/94](https://github.com/arviz-devs/arviz/issues/94)

Not sure how arviz handles KDE plot failed @RavinKumar, @aloctavodia?

---

<div class="post-metadata">

**Author:** ![aloctavodia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aloctavodia/32/8642_2.png) [@aloctavodia](https://discourse.pymc.io/u/aloctavodia)\
**Post date:** [March 9, 2019, 12:20pm UTC](https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878/3 "2019-03-09T12:20:06Z")

</div>

KDE will fail if all the elements of the input array are `nan` or `inf` or exactly the same number, or very short array (less than 3 or so). `trace_plot` will fail for those case too, only variables before the failing point will be plotted. I will send a PR to better deal with these cases.

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [March 9, 2019, 1:08pm UTC](https://discourse.pymc.io/t/turn-off-kde-plot-failed-from-traceplot/2878/4 "2019-03-09T13:08:28Z")

</div>

I think printing a warning for those cases and skip them should do.
