labelleft=0, labelright=1, ) ax1.tick_params(labelsize=plot_utils.TICK_SIZE) ax2.tick_params(labelsize=plot_utils.TICK_SIZE) ax2.tick_params(labelsize=plot_utils.TEXT_SIZE, which="minor") figure.set_size_inches(6.4, 2.6) figure.subplots_adjust(left=0.09, bottom=0.16, right=0.93, top=0.9, wspace=0.04, hspace=0.2) filename = "newton_linear_converge.pdf" path = plot_utils.get_path("compensated-newton", filename) figure.savefig(path) print("Saved {}".format(filename)) plt.close(figure) def main(): image1() image2() if __name__ == "__main__": plot_utils.set_styles() main()
from mpl_toolkits.axes_grid1 import make_axes_locatable import moleculetools as mt from mpl_toolkits.mplot3d import Axes3D import plot_utils as pu import numpy as np from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score #rc('font', **{'family':'sans-serif', 'sans-serif':['Helvetica Neue'], #'weight':'light', 'size':12}) ##plt.rcParams['pdf.fonttype'] = 42 #plt.rcParams['lines.linewidth'] = 1 #plt.rcParams['lines.markeredgewidth'] = 0 #plt.rcParams['lines.markersize'] = 4.5 #plt.rcParams['lines.markeredgecolor'] = (0, 0, 0, 0) pu.set_styles() def make_colormap(seq): """Return a LinearSegmentedColormap seq: a sequence of floats and RGB-tuples. The floats should be increasing and in the interval (0,1). """ seq = [(None,) * 3, 0.0] + list(seq) + [1.0, (None,) * 3] cdict = {'red': [], 'green': [], 'blue': []} for i, item in enumerate(seq): if isinstance(item, float): r1, g1, b1 = seq[i - 1] r2, g2, b2 = seq[i + 1] cdict['red'].append([item, r1, r2]) cdict['green'].append([item, g1, g2]) cdict['blue'].append([item, b1, b2])