Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
871 B
1
Indexable
Never
import matplotlib.pyplot as plt
import numpy as np

# Data
data = [0.438, 0.429, 0.443, 0.440, 0.436, 0.441, 0.435, 0.424, 0.433, 0.442, 0.436, 0.445, 0.436, 0.447, 0.440, 0.430, 0.432, 0.430, 0.439, 0.434, 0.438, 0.434, 0.432, 0.436, 0.441, 0.432, 0.437, 0.431, 0.426, 0.439, 0.434, 0.427, 0.436, 0.430, 0.431, 0.431, 0.428, 0.437, 0.436, 0.433, 0.440, 0.428, 0.428, 0.425, 0.433, 0.439, 0.435, 0.432, 0.435, 0.427, 0.446, 0.435, 0.435, 0.429, 0.434, 0.435, 0.432, 0.435, 0.444, 0.437]

# Sort the data
data.sort()

# Calculate cumulative relative frequencies
cumulative_relative_freq = np.arange(1, len(data) + 1) / len(data)

# Create a plot for the relative ogive
plt.plot(data, cumulative_relative_freq, marker='o', linestyle='-')
plt.xlabel('Value')
plt.ylabel('Cumulative Relative Frequency')
plt.title('Relative Ogive')
plt.grid(True)

# Show the plot
plt.show()