I have a bunch of data cotaining coordinate intervals within one large region, which i want to plot and then create a density plot showing where in the region there are more interval lines than others.
As a very basic example i've just plotted some horizontal lines for a given interval. I cant really find any good examples of how to create a better plot of intervals. I've looked into seaborn, but im not entirely sure about it. So here i've just created a basic example of what i am trying to do.
import numpy as np
import matplotlib.pyplot as plt
x1 = np.linspace(1, 30,100)
x2 = np.linspace(10,40,100)
x3 = np.linspace(2,50,100)
x4 = np.linspace(40,60,100)
x5 = np.linspace(30,78,100)
x6 = np.linspace(82,99,100)
x7 = np.linspace(66,85,100)
x = [x1,x2,x3,x4,x5,x6,x7]
y = np.linspace(1,len(x),len(x))
fig, ax = plt.subplots()
for i in range(len(x)):
ax.hlines(y[i], xmin=x[i][0], xmax=x[i][-1], linewidth=1)
plt.xlim(-5,105)
plt.show()
And then I would like to create a density plot of the number of intervals overlapping. Could anyone have any suggestions on how to proceed with this?
Thans for your help and suggestions