# -*- coding: utf-8 -*- """ This Python script plots FIG_1b of the Paper "Artificial Upwelling - A New Narrative" and was written by M. Juerchott (mjuerchott@geomar.de) on the 12th September 2022. The used values for preDIC and DICR are calculated from the PyFerret script VALUES_FIG_1b_S7.jnl """ # import python libraries import numpy as np import matplotlib.pyplot as plt # create arrays to plot # numbers were calculated with the PyFerret script VALUES_FIG_1b_S7.jnl # RPC 8.5 6.0 4.5 2.6 0.0 preDIC =( 35.53+40.05, 14.72+36.71,4.534+35.15,-10.02, -9.815 ) DICR =( 40.05, 36.71, 35.15, 32.34, 15.47 ) # plot routine fig, ax = plt.subplots() plt.rcParams['font.size'] = '17' plt.rcParams["font.family"] = "Times New Roman" plt.rcParams["font.weight"] = "bold" plt.rcParams["axes.labelweight"] = "bold" label = ('RCP 8.5', 'RCP 6.0', 'RCP 4.5', 'RCP 2.6', 'RCP 0.0') y_pos = np.arange(len(label)) ax.barh(y_pos, preDIC, align='center', color='r') ax.barh(y_pos, DICR, align='center', color='g') ax.set_yticks(y_pos, labels=label) ax.set_xlim(-20,80) ax.invert_yaxis() # labels read top-to-bottom ax.set_xlabel('\u0394C [Pg]') plt.rcParams["font.weight"] = "normal" ax.legend(labels=['solubility pump', 'biological carbon pump']) # plot black zero line abc = [-0,0] zeroline = [-0.4,4.4] ax.plot(abc, zeroline,linewidth=2.0, color='k') # set figure size fig.set_figwidth(8) fig.set_figheight(7) plt.show() # save figure fig.savefig("FIG_1b.png", dpi=300) fig.savefig("FIG_1b.pdf", dpi=300)