I would like to draw/plot a "bracket" (to keep it simple, it is a sequence of points that forms an arc) as shown in red in the first picture.
I created the bracket in another figure, but I do not know how to include/draw/plot it in the first figure. Here is the bracket, that would be transformed as needed to fit the space between the small labels and the group Labels.
Here is the MWE:
import matplotlib.pyplot as plt
import numpy as np
fig, axs = plt.subplots(8, 1, figsize=(8,9), sharex=True)
for i, ax in enumerate(axs.flat):
ax.plot([1,2])
ax.set_ylabel('Label ' + str(i))
axs[7].set_xlabel('The common x Label')
plt.annotate('Group Label (0,1,2,3)', xy=(.02, 0.7), rotation=90, xycoords='figure fraction',
horizontalalignment='center', verticalalignment='center', fontsize=14, color='k')
plt.annotate('Group Label (4,5,6,7)', xy=(.02, 0.3), rotation=90, xycoords='figure fraction',
horizontalalignment='center', verticalalignment='center', fontsize=14, color='k')
# Plot a 'bracket'
plt.figure()
npoints = 100
td = np.linspace(np.pi*3/4, np.pi*5/4, npoints)
xd = np.cos(td)
yd = np.sin(td)
plt.plot(xd,yd)
Edit: I believe using a PathPatch would be the best solution, like in this Matplotlib example. I just don't know how to do it.