import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar fig, ax = plt.subplots(figsize=(3, 3)) bar0 = AnchoredSizeBar(ax.transData, 0.3, 'unfilled', loc='lower left', frameon=False, size_vertical=0.05, fill_bar=False) ax.add_artist(bar0) bar1 = AnchoredSizeBar(ax.transData, 0.3, 'filled', loc='lower right', frameon=False, size_vertical=0.05, fill_bar=True) ax.add_artist(bar1) plt.show()