---
title: "Plotting a variable with discrete and continuous elements"
canonical: "https://modelassist.epixanalytics.com/space/EA/26575471/Plotting%20a%20variable%20with%20discrete%20and%20continuous%20elements"
format: markdown
---
If a risk event does not occur, we could say it has zero impact, but if it occurs it will have an uncertain impact. For example: a fire may have a 20% chance of occurring, and if it does, will incur £Lognorm(120000,30000). We could [model](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575635/) this as:

 

=Binomial(20%, 1)*Lognormal(120000,30000)

 

Running a simulation with this variable as an output we would get the following, highly uninformative, [relative frequency](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575468/) histogram plot (shown with different numbers of bars):

 

![image](media://fbdbaa50-66c4-4b3e-a9ed-a5464924f43a)

 

![image](media://102296b7-87a3-4ed5-acf2-d897259e79ce)

 

There really is no useful way to show such a distribution as a histogram, because the spike at zero (in this case) requires a relative frequency scale, while the continuous component requires a continuous scale. A [cumulative distribution](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575222/), however, would produce the following plot which is meaningful:

 

![image](media://a21f761f-d2ce-4011-8b85-1e3b3997182b)

 

 

 

---