0

I want to plot a histogram of an array. In x-axis I want to plot the values and in y-axis I want to plot the total number of elements in the array. How should I plot it? here is my array.Thanks in advance. I know how to plot the values but I don't know how to plot the total number of elements in y-axis.

[-0.1286385  -0.8456761  -0.95667267  0.06595946  0.78725716 -0.96428178
 -0.87616352  0.35353555  0.04112559  0.34965274  0.56990385 -0.62902429
  0.26539379  0.18312748  0.70591512  0.69791719 -0.52411982 -0.79432468
  0.68757033  0.48375113 -0.64103554  0.21627639 -0.81852819  0.99536198
  0.94046895 -0.06609427 -0.00627846  0.20028275  0.36961461  0.90935696
 -0.76545115 -0.57905796  0.04596451  0.96142961 -0.11043977  0.00557756]
M. ahmed
  • 53
  • 2
  • 11

1 Answers1

3

Use matplotlib

import matplotlib.pyplot as plt
plt.hist(your_array)
plt.show()
Daniel Severo
  • 1,768
  • 2
  • 15
  • 22
  • 1
    I don't know why this was downvoted - it's correct. You can additionally pass the number of bins as `plot.hist(arr, n)` – anon01 Dec 03 '18 at 06:03