[Matplotlib-users] plotting distributions, direct input of histogram

Neal Becker ndbecker2 at gmail.com
Fri Aug 2 07:32:13 EDT 2019


I'm frequently plotting distributions using e.g., boxplot, violinplot.   But 
I've already binned my data using my own histogram class.  So I already have 
an array of bins, and array of counts for each bin.

I don't see any way to directly input this data to plotting routines such as 
boxplot or violinplot.  What I've been doing is using collections.Counter to 
convert this into a single array, for example if the value '10' occurs 
'1000' times, I produce an array with [10]*1000.  Obviously, this doesn't 
scale to 10's of millions of samples.

Is there any way to input my data that already has been binned and counted?

Thanks,
Neal

(Also, I really wish the same for seaborn)



More information about the Matplotlib-users mailing list