You should try to find the data source so don't have to parse for a finish graph image.
Can be a interesting problem to get data from a image,so as a test i use
pytesseract,
Pillow.
tesseract from command line as Pedroski55 use is also good solution.
Then i give data to Pandas and try to recreate the same graph.
import pandas as pd
import matplotlib.pyplot as plt
adjusted_data = [
{'Time Interval': '8 - 8:59 am', 'Weekday (%)': 6, 'Weekend (%)': 3},
{'Time Interval': '9 - 9:59 am', 'Weekday (%)': 10, 'Weekend (%)': 7},
{'Time Interval': '10 - 10:59 am', 'Weekday (%)': 12, 'Weekend (%)': 11},
{'Time Interval': '11 - 11:59 am', 'Weekday (%)': 14, 'Weekend (%)': 17},
{'Time Interval': 'Noon - 12:59 pm', 'Weekday (%)': 14, 'Weekend (%)': 16},
{'Time Interval': '1 - 1:59 pm', 'Weekday (%)': 12, 'Weekend (%)': 14},
{'Time Interval': '2 - 2:59 pm', 'Weekday (%)': 10, 'Weekend (%)': 13},
{'Time Interval': '3 - 3:59 pm', 'Weekday (%)': 8, 'Weekend (%)': 10},
{'Time Interval': '4 - 4:59 pm', 'Weekday (%)': 8, 'Weekend (%)': 9},
{'Time Interval': '5 - 5:59 pm', 'Weekday (%)': 11, 'Weekend (%)': 8},
{'Time Interval': '6 - 6:59 pm', 'Weekday (%)': 11, 'Weekend (%)': 7},
{'Time Interval': '7 - 7:59 pm', 'Weekday (%)': 7, 'Weekend (%)': 5}
]
df = pd.DataFrame(adjusted_data)
fig, ax = plt.subplots(figsize=(10, 8))
df.plot(
x='Time Interval',
kind='barh',
ax=ax,
color=['skyblue', 'orange'],
edgecolor='black',
width=0.6
)
ax.set_title('Share of U.S. Grocery Shoppers by Time of Day (2014-17)', fontsize=14, weight='bold')
ax.set_xlabel('Percent on an average day', fontsize=12)
ax.set_ylabel('Time of Day', fontsize=12)
ax.legend(title='Day Type', loc='upper right')
ax.grid(True, axis='x', linestyle='--', alpha=0.7)
ax.invert_yaxis()
ax.set_xlim(0, 25)
plt.tight_layout()
plt.show()
Original image:
![[Image: share_of_us_grocery_shoppers_768px.png?v=6385.7]](https://www.ers.usda.gov/webdocs/charts/95393/share_of_us_grocery_shoppers_768px.png?v=6385.7)