import numpy as np import matplotlib.pyplot as plt from matplotlib import cbook np.random.seed(0) fig, ax = plt.subplots(figsize=(4, 6)) ax.set_yscale('log') data = np.random.lognormal(-1.75, 2.75, size=37) stats = cbook.boxplot_stats(data, labels=['arithmetic']) logstats = cbook.boxplot_stats(np.log(data), labels=['log-transformed']) for lsdict in logstats: for key, value in lsdict.items(): if key != 'label': lsdict[key] = np.exp(value) stats.extend(logstats) ax.bxp(stats) fig.show()