Skip to content
Advertisement

How to get data from matplotlib bar chart

How does one retrieve data programmatically from a matplotlib bar chart? I can do it for a matplotlib line chart as follows, so maybe I’m fairly close:

JavaScript

for a bar chart, however, there are no lines, and I’m unclear what the equivalent object is:

JavaScript

FWIW, here are a couple of related postings (that don’t go into bar charts):

Advertisement

Answer

JavaScript

enter image description here

Advertisement