I am trying to plot array with binary values using eventplot
time_steps = 5
num_features = 5
values_chart = np.zeros((num_features, time_steps))
for i in range(time_steps):
if i < time_steps // 4:
values_chart[:, i] = np.random.binomial(1, 0.02, num_features)
elif i < time_steps // 2:
values_chart[:, i] = np.random.binomial(1, 0.1, num_features)
else:
values_chart[:, i] = np.random.binomial(1, 0.02, num_features)
print(values_chart)
plt.eventplot(values_chart,linelengths = 0.1)
plt.gca().invert_yaxis()
plt.ylabel('Num Features')
plt.xlabel('Timesteps')
plt.show()
Test code from Eventplot
neuralData = np.random.random([5, 5])
print(neuralData)
plt.eventplot(neuralData,linelengths = 0.1)
plt.gca().invert_yaxis()
plt.show()
Question is, why the first plot fails? or i misunderstood eventplot? Note: Increase in timesteps/num_features has no change in result.
Aucun commentaire:
Enregistrer un commentaire