-1

I have 4 sets of raw data values,

  • Data value before change @25 degrees
    ex:[1, 2, 3,..., 10]
  • Data value before change @79 degrees
    ex:[0.5, 1, 1.5,..., 5]
  • Data value after change @25 degrees
    ex:[5, 6, 7,..., 15]
  • Data value after change @79 degrees
    ex:[2.5, 3, 3.5,..., 7.5]

And I would like to create a histogram using these data sets, where each data set is its own series. Each data set would be stored in its own array, so it will not need any separation.

1 Answers1

0
from matplotlib import pyplot as plt
import numpy as np

# create sample data
d1 = np.random.normal(10, 5, 100)
d2 = np.random.normal(4, 1, 100)
d3 = np.random.normal(20, 4, 100)
d4 = np.random.normal(2, 1, 100)

f, ax = plt.subplots()

ax.hist(d1, label='d1')
ax.hist(d2, label='d2')
ax.hist(d3, label='d3')
ax.hist(d4, label='d4')
ax.legend()
plt.show()

enter image description here

AlexWach
  • 592
  • 4
  • 16