This Python program receives a list of numbers and draws a simple minigram using each element’s index and value.
The horizontal axis represents the index, and the vertical axis shows the corresponding value.
This visual is useful for quick data inspection and trend observation.
import matplotlib.pyplot as plt
# Sample list of numbers
data = [3, 7, 2, 9, 5]
# Draw minigram using index and value
plt.plot(range(len(data)), data, marker='o', linestyle='-', color='purple')
# Label axes
plt.xlabel("Element Index")
plt.ylabel("Value")
plt.title("Minigram of Numeric List")
# Show grid and display chart
plt.grid(True)
plt.show()
- The list data contains numeric values
- range(len(data)) generates the index for each element
- plot() draws a line chart with markers
- Axes are labeled for clarity
- The final chart is displayed using show()