Matplotlib stacked and grouped histogram

Question:

I’m trying to compare 2 datasets with a histogram. I have a pandas dataframe which contains 3 columns: username (cleaned for anonymity), a series of lists of time frequency data, and a type column.

My goal is to make a grouped histogram with the goal of comparing the 2 different types against one another in each histogram bin, but I want each comparison bar to be a stacked bar representing the contribution of each user.

import pandas
import ast
generic = lambda x: ast.literal_eval(x)
aa=pd.read_csv('Data/aa.csv', header=0, names=('middle', 'name', 'type'), converters={'middle':generic, 'type':np.int64})

I’ve been able to get stacked bar charts within each type (without comparison between types):

plt.hist(aa[aa['type']==1]['middle'], stacked=True, bins=24) #24 bins correspond to hours, this is time frequency data
plt.title("type 1 stacked bar")
plt.show()
plt.hist(aa[aa['type']==2]['middle'], stacked=True, bins=24)
plt.title("type 2 stacked bar")
plt.show()

type 1 stacked bar
type 2 stacked bar

and I’ve also been able to get the comparison between the two types (without bar stacking):

aa2 = aa.explode('middle', ignore_index=True)
plt.hist((aa2[aa2['type']==1]['middle'],(aa2[aa2['type']==2]['middle'])), bins=24)
plt.title('type 1 vs type 2 stacked bar')
plt.show()

bar comparison

My aim is to have this last chart but with the solid orange and blue replaced with the stacks of color from the above two images. I have no intention of being able to track which user contributed where- the main thing I’m trying to capture is the number of different users who contribute to a particular bar. With this in mind, I think it’d also be nice to give an overall color palette to type 1 and type 2, if possible.

My previous tries are below:

plt.hist(x=(aa[aa['type']==1]['middle'], aa[aa['type']==2]['middle']), 
         stacked=True, bins=24)
plt.show()
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[108], line 1
----> 1 plt.hist(x=(aa[aa['type']==1]['middle'], aa[aa['type']==2]['middle']), stacked=True, bins=24)

File ~AppDataRoamingPythonPython311site-packagesmatplotlibpyplot.py:2581, in hist(x, bins, range, density, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, data, **kwargs)
   2575 @_copy_docstring_and_deprecators(Axes.hist)
   2576 def hist(
   2577         x, bins=None, range=None, density=False, weights=None,
   2578         cumulative=False, bottom=None, histtype='bar', align='mid',
   2579         orientation='vertical', rwidth=None, log=False, color=None,
   2580         label=None, stacked=False, *, data=None, **kwargs):
-> 2581     return gca().hist(
   2582         x, bins=bins, range=range, density=density, weights=weights,
   2583         cumulative=cumulative, bottom=bottom, histtype=histtype,
   2584         align=align, orientation=orientation, rwidth=rwidth, log=log,
   2585         color=color, label=label, stacked=stacked,
   2586         **({"data": data} if data is not None else {}), **kwargs)

File ~AppDataRoamingPythonPython311site-packagesmatplotlib__init__.py:1433, in _preprocess_data.<locals>.inner(ax, data, *args, **kwargs)
   1430 @functools.wraps(func)
   1431 def inner(ax, *args, data=None, **kwargs):
   1432     if data is None:
-> 1433         return func(ax, *map(sanitize_sequence, args), **kwargs)
   1435     bound = new_sig.bind(ax, *args, **kwargs)
...
-> 6715         xmin = min(xmin, np.nanmin(xi))
   6716         xmax = max(xmax, np.nanmax(xi))
   6717 if xmin <= xmax:  # Only happens if we have seen a finite value.

TypeError: '<' not supported between instances of 'list' and 'float'

and:

plt.hist(x=(aa2[aa2['type']==1]['middle'], aa2[aa2['type']==2]['middle']), 
         stacked=True, bins=24)
plt.show()

stacks are of each type rather than being contributions of each type

I think my 2 ways forward are to somehow stitch the first 2 histograms together (no idea how), or to somehow color the 3rd histogram using data from the first 2 (again, no idea how).

I’m open to other ways of presenting this data as well! Any thoughts or suggestions are welcome.

Data

aa.csv file linked here on pastebin: https://pastebin.com/DjLD0vbk

Following is a subset of the data (that fits in the question).

middle,name,type
"[8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.25, 10.75, 10.625, 10.875, 16.75, 9.25, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75, 8.75]",0,1
"[8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 8.125, 7.875, 8.125]",1,1
"[10.25, 11.25, 6.25, 14.5, 6.75, 8.5, 8.5, 10.875, 16.5, 15.5, 10.0, 15.5, 12.5, 7.75, 9.25, 5.5, 9.75, 10.25, 5.75, 16.125, 8.5, 10.75, 7.5, 13.25, 9.125, 9.0, 7.0, 7.875, 11.0, 15.5, 6.75, 9.75, 11.0, 8.5, 8.125, 17.375, 7.125, 11.0, 15.5, 9.75, 15.25, 12.25, 10.5, 13.25, 10.0, 9.0, 16.25, 12.5, 16.5, 6.625, 10.25, 7.5, 10.75, 12.25, 10.25, 9.25, 11.25, 11.75, 10.0, 10.875, 11.0, 9.75, 14.125, 12.375, 11.625, 10.0, 10.75, 17.0, 5.75, 13.375, 16.5, 6.5, 12.5, 10.625, 9.0, 10.625, 9.375, 10.625, 9.875, 16.5, 12.875, 7.75, 8.75, 8.5, 12.0, 17.75, 14.0, 9.25, 11.5, 13.0, 10.125, 14.125, 11.25, 10.5, 7.0, 10.375, 10.5, 9.25, 7.25, 13.25, 8.75, 9.5, 6.5, 10.0, 7.5, 16.5, 10.25, 10.125, 7.375, 14.25, 6.5, 13.0, 7.5, 14.5, 10.5, 11.375, 8.5, 10.25, 10.25, 18.0, 10.25, 8.25, 11.875, 8.5, 10.75, 10.25, 18.5, 16.5, 10.25, 13.0, 10.5, 9.0, 8.5, 8.375, 9.75, 12.75, 12.125]",2,1
"[18.875, 13.625, 14.25, 6.25, 6.0, 6.25, 22.875, 22.875, 21.875, 11.875, 13.125, 19.625, 9.25, 18.75, 13.125, 9.25, 16.75, 19.0, 13.125, 6.625, 18.75, 14.875, 9.25, 5.25, 5.25, 5.25, 7.5, 5.25, 18.5, 5.25, 5.5, 8.5, 13.125, 17.625, 13.125, 7.125, 4.375, 19.5, 9.25, 18.625, 9.25, 18.25, 9.25, 8.25, 19.5, 13.125, 19.375, 9.25, 18.5, 19.0, 7.875, 9.0, 12.0]",3,1
"[19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 20.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 21.375, 19.125, 20.5, 20.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 20.375, 19.5, 19.5, 19.5, 19.5, 19.5, 20.5, 20.5, 20.5, 20.25, 20.5, 20.875, 19.625, 20.25, 21.0, 20.25, 20.25, 20.75, 20.25, 20.25, 20.25, 20.25, 19.5, 20.25, 20.25, 19.125, 20.25, 20.25, 20.75, 19.5, 20.5, 20.5, 20.5, 20.5, 20.5, 20.5, 21.375, 22.0, 19.5, 20.5, 19.25, 20.25, 20.25, 19.25, 20.25, 20.25, 20.5, 20.25, 20.25, 20.25, 20.375, 20.25]",4,1
[17.75],5,1
"[12.5, 8.0, 13.5, 15.0, 15.75, 12.5, 12.5, 16.5, 14.0, 9.5, 12.5, 9.5, 10.5, 16.75, 13.25, 16.5, 15.5, 13.5]",6,1
"[8.75, 14.25, 8.75, 16.75, 16.75, 16.75, 8.75, 8.75, 16.75, 8.75, 16.75, 14.25, 8.75, 16.75, 8.75, 16.75, 14.25, 8.75, 16.75, 8.75, 16.75, 14.25, 14.25, 16.75, 8.75, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 8.75, 16.75, 8.75, 16.75, 14.25, 14.25, 14.25, 16.75, 14.25, 14.25, 14.25, 8.5, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 12.75, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 8.75, 16.75, 8.75, 16.75, 8.75, 16.75, 14.25, 14.25, 8.75, 16.75, 8.75, 16.75, 8.75, 16.75, 14.25, 14.75, 8.75, 16.75, 8.75, 14.25, 14.25, 8.75, 16.75, 8.75, 16.75, 14.25, 14.25, 8.75, 14.25, 16.75, 8.75, 16.75, 8.75, 16.75, 14.25, 14.25, 14.25, 14.25, 14.25, 12.375, 11.375, 17.25, 12.125, 7.0, 14.25, 15.0, 13.375, 9.375, 14.875, 7.0, 14.25, 19.75, 7.0, 13.375, 16.875, 18.625, 14.25, 14.75, 14.25, 14.75, 12.75, 7.0, 13.375, 6.75, 14.5, 6.75, 14.5, 15.625, 17.5, 7.25, 14.25, 13.375, 14.25, 7.0, 6.75, 14.5, 9.5, 16.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 16.75, 18.625, 19.625, 14.25, 14.25, 14.25, 8.75, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 14.25, 16.25, 11.625, 15.5, 10.875, 11.625, 15.375, 6.375, 6.375, 6.375, 6.375, 6.375, 6.375, 6.375, 7.0, 14.25, 17.375, 6.5, 14.25, 11.125, 15.0, 16.875, 14.5, 14.25, 10.875, 12.5, 13.625, 17.375, 15.0, 6.375, 6.375]",7,1
"[11.5, 20.5, 22.25, 18.625, 3.25, 1.25, 11.25, 20.25, 20.125, 18.75, 3.0, 1.125, 23.25, 21.75, 12.375, 17.125, 21.375, 22.125, 22.75, 16.75, 16.25, 14.75, 13.375, 20.25, 12.0, 1.875, 17.5, 0.5, 12.0, 0.75, 0.5, 23.0, 3.0, 20.375, 19.625, 12.0, 15.125, 1.25, 18.625, 14.375, 13.125, 12.25, 18.875, 3.25, 0.75, 23.125, 11.5, 16.875, 16.25, 16.375, 17.875, 6.5, 14.75, 9.0, 17.0, 10.0, 13.125, 11.875, 8.75, 7.75, 7.75, 7.5, 7.75, 15.5, 10.875, 17.25, 15.0, 7.75, 18.0, 11.75, 7.75, 7.75, 18.25, 7.5, 6.5, 7.75, 7.75, 9.375, 7.75, 19.25, 18.375, 11.875, 7.75, 18.5, 7.75, 17.75, 13.125, 9.125, 5.25, 6.0, 6.75, 16.25, 10.75, 16.5, 14.0, 14.625, 16.25, 7.125, 16.75, 7.0, 19.5, 19.375, 7.75, 6.0, 11.0, 19.25, 7.0, 18.75, 8.75, 14.125, 12.875, 10.75, 18.75, 17.25, 19.375, 17.875, 7.75, 6.5, 7.75, 18.0, 11.75, 8.0, 11.75, 18.5, 14.25, 12.75, 16.75, 11.75, 12.375, 14.0, 17.5, 13.75, 13.125, 14.25, 9.375, 17.5, 17.875, 17.5, 9.875, 19.75, 17.0, 12.5, 12.125, 17.375, 14.25, 12.125, 14.75, 17.75, 11.0, 2.5, 17.25, 15.25, 13.75, 11.5, 14.5, 2.5, 17.5, 17.625, 12.125, 17.625, 17.625, 14.5, 17.625, 15.75, 8.5, 9.5, 16.875, 18.0, 9.625, 17.875, 16.75, 9.75, 14.625, 12.875, 17.25, 9.25, 17.75, 9.875, 17.875, 9.75, 18.0, 16.5, 13.5, 16.25, 20.75, 18.25, 17.25, 12.375, 16.875, 13.125, 12.125, 17.375, 14.25, 12.75, 17.875, 13.25, 12.125, 17.875, 7.625, 12.5, 18.0, 10.25, 10.125, 17.5, 14.5, 17.875, 15.375, 11.375, 10.125, 18.125, 11.125, 2.5, 2.5, 2.5, 2.5, 11.0, 18.25, 12.875, 11.75, 19.0, 2.5, 16.375, 9.0, 10.125, 14.125, 9.0, 15.5, 2.5, 2.5, 20.875, 17.125, 17.75, 10.75, 14.75, 13.5, 16.75, 15.75, 18.75, 17.625, 15.25, 15.875, 15.875, 19.25, 10.875, 8.25, 8.125, 16.5, 15.75, 15.0, 18.875, 21.625, 8.0, 18.0, 20.625, 18.375, 13.875, 13.0, 18.625, 18.0, 17.0, 16.375, 10.25, 10.25, 22.25, 18.375, 20.25, 18.625, 20.625, 14.25, 11.25, 10.5, 16.125, 7.75, 6.5, 12.75, 11.25, 10.125, 8.125, 13.125, 11.625, 8.5, 20.25, 14.75, 7.75, 18.5, 16.875, 7.75, 15.375, 17.125, 9.5, 18.625, 7.625, 12.0, 16.25, 14.75, 10.75, 9.75, 7.5, 6.5, 17.875, 10.5, 15.0, 12.75, 10.75, 7.125, 20.25, 7.75, 17.375, 19.25, 18.25, 21.25, 18.75, 10.375, 9.5, 12.5, 11.25, 9.0, 18.375, 20.25, 17.75, 14.0, 12.625, 17.375, 15.25, 13.75, 12.5, 20.75, 10.75, 11.875, 14.0, 10.125, 10.75, 17.25, 15.375, 13.25, 7.625, 10.375, 8.125, 16.625, 17.875, 18.25, 17.625, 16.25, 12.875, 17.75, 14.5, 10.625, 17.5, 6.625, 16.75, 12.625, 11.625, 9.125, 21.5, 18.0, 12.375, 17.625, 12.0, 18.0, 17.75, 20.125, 17.875, 13.375, 6.75, 7.625, 10.75, 9.625, 8.25, 12.375, 17.5, 17.375, 17.625, 17.125, 12.5, 18.5, 17.5, 16.375, 14.75, 17.375, 10.25, 18.5, 17.5, 1.75]",8,1
"[14.5, 11.5, 11.5, 6.75, 14.5, 11.5, 11.5, 6.75, 6.75, 6.75, 14.5, 11.5, 11.5, 6.75, 14.5, 11.5, 11.5, 14.5, 14.5, 11.5, 11.5, 6.75, 14.5, 6.75, 14.5, 11.5, 11.5, 6.75, 6.75, 14.5, 11.5, 11.5, 6.75, 14.5, 11.5, 11.5, 6.75, 14.5, 6.75, 14.5, 11.5, 11.5, 6.75, 14.5, 11.5, 11.5, 6.75, 6.75, 14.5, 14.5, 11.5, 11.5, 14.5, 6.75, 14.5, 6.75, 11.5, 11.5, 6.75, 14.5, 11.5, 6.75, 14.5, 6.75, 14.5, 11.5, 11.5, 6.75, 14.5, 11.5, 11.5, 14.5, 6.75, 11.5, 11.5, 14.5, 6.75, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5]",9,1
"[18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 18.5, 6.625, 11.625, 7.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 15.375, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 11.625, 18.5, 6.625, 12.25, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.625, 6.625, 18.5, 11.625, 7.625, 6.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 18.5, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 7.625, 11.625, 18.5, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 11.625, 7.625, 12.25, 11.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 7.625, 18.5, 6.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 12.25, 6.625, 18.5, 11.625, 7.625, 18.5, 11.625, 7.625, 18.5, 11.625]",10,1
"[19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 4.5, 19.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 19.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 4.5, 19.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 4.5, 4.5, 19.5, 19.5, 4.5, 19.5, 4.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 19.5, 4.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 4.5, 19.5, 4.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 4.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 19.5, 4.5, 4.5, 19.5, 4.5, 19.5, 4.5, 19.5, 19.5, 19.5, 4.5, 9.375, 19.5, 4.5, 14.5, 5.5, 19.5, 17.375, 4.5, 19.5, 17.5, 9.5, 6.75, 4.5, 19.5, 4.5]",11,1
"[6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 6.75, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 11.5, 6.75, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 6.75, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 14.5, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 6.75, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5]",12,1
"[17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5, 17.5]",13,1
"[5.5, 8.0, 18.625, 5.75, 5.75, 6.375, 7.5, 6.375, 6.375, 6.375, 18.25, 5.0, 6.75, 5.5, 5.5, 5.625, 5.75, 5.625, 12.25, 7.0, 19.25, 7.25, 17.5, 19.0, 7.25, 17.5, 19.0, 7.125, 18.625, 7.5, 18.875, 7.0, 7.5, 5.75, 7.875, 6.0, 8.0, 7.0, 8.0]",14,1
"[4.875, 7.875, 4.875, 15.5, 4.875, 7.875, 7.875, 4.875, 15.5, 4.875, 13.125, 4.875, 7.875, 7.875, 4.875, 13.125, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 4.875, 7.875, 7.875, 15.5, 4.875, 7.875, 7.875, 4.875, 15.5, 4.875, 7.875, 7.875, 4.875, 7.875, 7.875, 11.75, 10.25, 10.125, 8.75, 13.5, 7.75, 4.75, 7.5, 12.125, 7.625, 10.5, 7.625, 6.0, 5.25, 5.875, 4.75, 7.375, 7.75, 9.5, 8.75, 18.5, 4.75, 7.875, 16.75, 7.75, 4.875, 7.875, 4.875, 4.875, 15.5, 4.875, 4.875, 4.875, 7.875, 7.875, 4.875, 15.5, 5.0, 4.875, 4.875, 4.875, 7.875, 7.875, 5.5, 7.875, 8.875, 9.375, 8.875, 16.75, 5.25, 17.625, 4.75, 14.25, 10.75, 5.0, 14.25, 10.75, 5.0, 14.25, 10.75, 5.0, 5.25, 14.25, 10.75, 10.75, 5.0, 4.75, 14.25, 10.75, 5.0, 5.0, 14.25, 5.75, 5.125, 5.125, 8.0, 10.25, 4.75, 5.125, 17.875, 4.75, 10.875, 5.25, 16.25, 14.25, 5.0, 10.75, 5.0, 14.25, 10.75, 5.0, 14.25, 10.75, 5.0, 14.25, 10.75, 7.875, 4.875, 4.875, 4.875, 15.5, 4.875, 13.125, 4.875, 7.875, 7.875, 4.875, 13.125, 4.875, 15.5, 13.125, 13.125, 4.875, 13.125, 4.875, 7.875, 7.875, 4.875, 13.125, 4.875, 15.5, 4.875, 4.875, 4.875, 4.875, 7.875, 13.125, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 4.875, 7.875, 7.875, 4.875, 13.125, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 4.875, 7.875, 13.125, 13.125, 4.875, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 4.875, 7.875, 7.875, 4.875, 13.125, 13.125, 13.125, 4.875, 13.125, 4.875, 11.25, 10.125, 9.625, 7.875, 4.875, 4.875, 15.5, 4.875, 4.875, 4.875, 4.875, 7.875, 7.875, 4.875, 13.125, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 7.875, 7.875, 7.875, 4.875, 4.875, 15.5, 4.875, 13.125, 4.875, 13.125, 4.875, 7.875, 13.125]",15,1
"[7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 11.5, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 14.5, 7.875, 7.875, 7.875, 7.875, 7.875, 6.75, 7.875, 7.875, 7.875, 7.875, 7.75, 7.875, 17.5, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 14.5, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 7.875, 6.5, 8.0, 14.5, 10.5, 6.75, 7.875, 7.875, 7.375, 8.0, 7.375, 7.375, 9.125, 9.5]",16,1
"[11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5]",17,1
"[11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5]",18,1
"[5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125, 5.125]",19,1
"[8.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 20.875, 8.875, 14.5, 14.5, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 8.875, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 14.5, 8.875, 20.875, 8.875, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 14.5, 8.875, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 20.875, 14.5, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 20.875, 14.5, 8.875, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 8.875, 14.5, 20.875, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 14.5, 8.875, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 20.875, 14.5, 8.875, 14.5, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 8.875, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5, 20.875, 14.5, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 8.875, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 14.5, 8.875, 14.5, 20.875, 8.875, 20.875, 20.875, 14.5, 8.875, 20.875, 14.5, 8.875, 14.5, 8.875, 20.875, 14.5, 8.875, 20.875, 14.5]",20,2
"[14.5, 6.75, 14.5, 14.5, 6.75, 6.75, 14.5, 6.75, 6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75]",21,2
"[8.375, 6.625, 9.25, 9.25, 14.25, 8.25, 6.625, 9.25, 8.375, 8.25, 6.625, 10.875, 8.375, 10.75, 8.375, 8.25, 8.25, 6.625, 8.375, 8.25, 6.625, 8.375, 6.625, 8.25, 8.25, 9.25, 9.25, 8.25, 9.25, 7.75, 8.375, 6.625, 6.625, 9.25, 8.25, 6.625, 8.375, 8.375, 10.25, 6.625, 8.25, 8.375, 9.25, 9.25, 9.25, 6.625, 9.25, 18.0, 7.25, 8.25, 9.25, 7.75, 18.0, 8.25, 9.25, 7.25, 9.25, 9.25, 8.25, 7.75, 18.0, 8.25, 9.25, 9.25, 7.75, 9.25, 9.25, 9.25, 7.25, 8.25, 18.0, 7.75, 9.25, 9.25, 7.25, 9.25, 8.25, 18.0, 7.75, 9.25, 8.25, 9.25, 18.0, 9.25, 9.25, 7.25, 9.25, 9.25, 7.75, 18.0, 8.25, 9.25, 9.25, 7.25, 9.25, 7.75, 18.0, 8.25, 9.25, 7.25, 9.25, 8.25, 18.0, 7.75, 9.25, 9.25, 9.25, 7.25, 9.25, 8.25, 18.0, 7.75, 9.25, 9.25, 9.25, 7.25, 8.25, 9.25, 7.25, 9.25, 9.25, 7.75, 18.0, 8.25, 9.25, 9.25, 9.25, 9.25, 9.25, 7.75, 18.0, 8.25, 9.25, 9.25, 7.25, 9.25, 8.25, 9.25, 9.25, 18.0, 7.75, 9.25, 7.25, 9.25, 18.0, 7.75, 9.25, 9.25, 9.25, 7.25, 7.25, 9.25, 18.0, 18.0, 18.0, 8.25, 9.25, 7.25, 9.25, 7.75, 8.25, 9.25, 9.25, 7.25, 9.25, 9.25, 9.25, 7.75, 7.75, 9.25, 9.25, 9.25, 7.25, 9.25, 8.25, 18.0, 7.75, 9.25, 9.25, 9.25, 7.25, 9.25, 8.25, 18.0, 7.75]",22,2
"[19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 19.375, 10.375, 10.375, 10.375, 19.75, 19.375]",23,2
"[8.0, 17.5, 17.75, 10.5, 14.5, 16.75, 11.0, 18.5, 17.25, 17.25, 17.25, 16.0, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25, 17.25]",24,2
"[17.25, 20.0, 16.625, 12.5, 19.5, 15.75, 14.125, 21.0, 15.0, 10.75, 15.5, 11.25, 14.5, 22.0, 19.0, 10.75, 13.5, 14.25, 19.25, 16.25, 12.75, 10.25, 19.25, 10.875, 17.25, 12.0, 19.5, 16.75, 14.0, 21.0, 9.5, 20.5, 12.0, 20.25, 14.5, 14.875, 10.75, 11.5, 18.5, 13.5, 10.75, 10.75, 22.0, 19.75, 20.0, 10.75, 20.5, 13.5, 20.75, 14.0, 22.5, 22.5, 0.25, 20.625, 11.125, 19.875, 10.5, 11.0, 20.5, 19.25, 14.875, 20.0, 11.25, 14.125, 13.0, 15.375, 20.5, 13.0, 17.25, 21.25, 8.0, 14.25, 11.625, 21.25, 20.125, 19.625, 11.75, 10.75, 16.625, 2.25, 17.25, 12.5, 19.0, 16.0, 11.0, 19.5, 14.5, 14.625, 17.0, 22.5, 17.375, 21.25, 10.625, 21.5, 14.625, 9.75, 13.25, 21.5, 11.0, 18.0, 21.0, 18.0, 15.25, 21.5, 12.5, 20.375, 9.75, 12.25, 21.5, 15.125, 21.25, 11.75, 10.75, 12.25, 13.25, 15.125, 21.0, 0.25, 10.875, 9.75, 7.25, 21.5, 21.75, 9.75, 21.0, 11.375, 14.5, 21.0, 17.0, 19.0, 21.25, 10.75, 14.875, 21.5, 13.25, 18.5, 21.5, 10.0, 21.625, 11.0, 20.75, 15.25, 13.25, 20.25, 11.5, 15.5, 20.75, 13.5]",25,2
"[14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5]",26,2
"[19.5, 19.5, 19.25, 19.5, 19.5, 19.5, 19.5, 19.25, 19.5, 19.5, 19.5, 19.25, 19.5, 19.5, 19.5, 19.5, 19.25, 19.5, 19.5, 19.5, 19.5, 19.25, 19.5, 19.5, 19.5, 19.5, 19.25, 19.5]",27,2
"[20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 20.25, 8.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25, 8.25, 20.25]",28,2
"[9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 22.125, 9.5, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 8.5, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 8.5, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 9.5, 22.125, 22.125, 10.375, 9.5, 8.5, 8.5, 8.5, 8.5, 8.5, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 22.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 10.375, 19.25, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 9.875, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 15.5, 10.375, 11.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 19.25, 19.25, 19.5, 19.25, 10.375, 19.25, 10.375, 8.5, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 8.5, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 8.5, 19.25, 10.375, 10.375, 10.375, 20.625, 19.25, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 8.5, 9.375, 10.375, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 8.5, 8.5, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 19.25, 9.125, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 22.625, 19.25, 10.375, 19.25, 10.375, 17.875, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 11.5, 9.375, 17.875, 8.875, 19.25, 19.25, 10.375, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 19.25, 10.375, 10.375, 13.5, 19.25, 17.0, 10.375, 19.25, 16.0, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 10.875, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 22.5, 19.25, 10.375, 16.5, 10.375, 19.25, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 14.5, 10.125, 19.25, 10.375, 19.25, 10.375, 19.25, 19.25, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 10.375, 19.25, 10.375, 23.125, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 13.25, 8.875, 19.25, 19.25, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25, 10.375, 19.25]",29,2
"[20.5, 16.25, 19.5, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125, 20.125]",30,2
"[15.25, 11.5, 19.5, 15.25, 11.5, 19.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5, 11.5]",31,2
"[12.75, 22.5, 22.5, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 12.75, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 22.5, 12.75, 16.75, 12.75, 16.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 22.5, 16.75, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 22.5, 16.75, 12.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 16.75, 12.75, 22.5, 12.75, 16.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 22.5, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 16.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 22.5, 12.75, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5, 12.75, 16.75, 22.5]",32,2
"[6.75, 14.5, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 14.5, 6.75, 11.5, 6.75, 14.5]",33,2
"[8.0, 7.125, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 7.125, 7.125, 8.0, 8.0, 6.75, 14.5, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0]",34,2
Asked By: trailrunnersquared

||

Answers:

My aim is to have this last chart but with the solid orange and blue replaced with the stacks of color from the above two images.

One option could be to plot both stacked histograms with a rwidth < 0.5 and then manually shift the x positions of the bars to have both histograms properly side by side.
Note that a solution using align="left" and align="right" does not seem to be easier here because of the rwidth < 1.

middle_type1 = aa[aa['type']==1]['middle']
middle_type2 = aa[aa['type']==2]['middle']

rwidth = 0.4

*_, bars_mt1 = plt.hist(middle_type1, stacked=True, bins=range(25), rwidth=rwidth, align="left")
*_, bars_mt2 = plt.hist(middle_type2, stacked=True, bins=range(25), rwidth=rwidth, align="left")

# Flatten bar containers
bars_mt1 = [bar for bars in bars_mt1 for bar in bars]
bars_mt2 = [bar for bars in bars_mt2 for bar in bars]

# Shift the bars to the left or right side of the ticks
for bar in bars_mt1:
    x, y = bar.xy
    bar.set_x(x + rwidth/2)
        
for bar in bars_mt2:
    x, y = bar.xy
    bar.set_x(x - rwidth/2)

I think it’d also be nice to give an overall color palette to type 1 and type 2, if possible.

It is possible. Here is an example with Blues colormap for type 1 and Reds colormap for type 2.

rcm = plt.get_cmap("Reds")
bcm = plt.get_cmap("Blues")

mt1_colors = rcm(np.linspace(0, 1, len(middle_type1)))
mt2_colors = bcm(np.linspace(0, 1, len(middle_type2)))

*_, bars_mt1 = plt.hist(..., color=mt1_colors)
*_, bars_mt2 = plt.hist(..., color=mt2_colors)

Adding xticks for each hour, here is the result.

enter image description here

Hope it matches what you want.

Answered By: thmslmr