PK!P5HHmolib/__init__.py__version__ = '0.2.0' from .figures import * from .colors import * PK!ttmolib/colors.pydef rescale_colors(color_list): # Rescale to values between 0 and 1 for i in range(len(color_list)): r, g, b = color_list[i] color_list[i] = (r / 255., g / 255., b / 255.) return color_list def tableau10(index): # Tableau 10 Colors tableau10_list = [(31,119,180),(255,127,14),(44,160,44),(214,39,40),(148,103,189),(140,86,75),(227,119,194),(127,127,127),(188,189,34),(23,190,207)]; tableau10_list = rescale_colors(tableau10_list) return tableau10_list[index] def tableau20(index): # Tableau 20 Colors tableau20_list = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150), (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148), (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199), (188, 189, 34), (219, 219, 141), (23, 190, 207), (158, 218, 229)] tableau20_list = rescale_colors(tableau20_list) return tableau20_list[index] def tableau10blind(index): # Tableau Color Blind 10 tableau10blind_list = [(0, 107, 164), (255, 128, 14), (171, 171, 171), (89, 89, 89), (95, 158, 209), (200, 82, 0), (137, 137, 137), (163, 200, 236), (255, 188, 121), (207, 207, 207)] tableau10blind_list = rescale_colors(tableau10blind_list) return tableau10blind_list[index]PK!U{ ePPmolib/figures.pyfrom pathlib import Path import matplotlib.pyplot as plt def add_subfig_label(ax, label, size=14): ''' Adds a subplot label to an axis.''' ax.text(-0.1, 1, label, transform=ax.transAxes, fontsize=size, fontweight='bold', va='top', ha='right') return ax def gen_sub_label(lower=False, paren=False): '''Generates the next letter in the alphabet as a subfig label. Label can be uppercase or lowercase, with optional parentheses. ''' letters = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z' labels = letters.lower().split(' ') if lower else letters.split(' ') for letter in labels: yield '('+letter+')' if paren else letter def label_subplots(fig, size=14): '''Adds letter labels to all subplots in a figure. Adjusts figure padding and left margin to make labels fit. ''' allaxes = fig.get_axes() sub_labels = gen_sub_label(paren=True) for ax in allaxes: add_subfig_label(ax, next(sub_labels), size=size) # plt.tight_layout(rect=[l_mar,0,1,1], w_pad=w_pad) def save_plot(output_filename, proj_dir=Path.cwd(), subdir=None, fig=None): ''' Function for saving plots and printing message.''' # make directory for plots, and save plot plots_dir = proj_dir/'plots' if subdir: plots_dir = plots_dir / str(subdir) plots_dir.mkdir(parents=True, exist_ok=True) output_file_path = plots_dir / (output_filename + '.png') if fig: fig.savefig(str(output_file_path), dpi=300) else: plt.savefig(str(output_file_path), dpi=300) print('Created plot: ' + str(output_file_path)) plt.close() PK!KUBBmolib-0.2.0.dist-info/LICENSEMIT License Copyright (c) 2018 Manuel Ochoa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!HnHTUmolib-0.2.0.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!Hѱە=molib-0.2.0.dist-info/METADATATMoFW C@b%;H.pj4 [i/wYR$ݝfޛٽE+kp\L64jgip~Pڊն|mhfneUI<;GMY[FԠSh{&rZ蟨CNOw_rAW+EڧnmP%kN?~uviYG4ȵK|IN~4xÈ_%^({ '|T#sk0Zv7S[X٭ɲ}Zyh|%#PhJj pD-8E/e*Z1-GVT= ڸAP@%*@M`yq-+j6[O!DF:Q`=<<[x]I2g}_&(I.l.˒ZGUପ@S\%i/*ǥE*a !mSGn/t:y;ra3Ef۪JD#9W[L|}+ 䁉$icx+1wMFAtI+yRs|v$da /yI\-KԞlQ887%g)bonkf SyI%[D~v\;XCتPMuW3{q=zyŗ ^ưX)MFcNo1EP*55JF72]9A_XfR[LH$w[MА|-;NUr+3>tgqLEO@u}T{.PK!HbfSmolib-0.2.0.dist-info/RECORDuKR0нg BgbFڤ@(`qq ūK<2V4EsÕSZ_q]ʹ똂.AqlfCcl LP; _1> ܌7NO㻁OqbE7|F ^Ej}I8WrZnգMu_V@3HQp.BvJv㢀_qr$()XKg5leJ)j4VChkS#"($D{Tm V X;:8{,+Ȝ v\T&Z*Ь~ 3_PK!P5HHmolib/__init__.pyPK!ttwmolib/colors.pyPK!U{ ePPmolib/figures.pyPK!KUBB molib-0.2.0.dist-info/LICENSEPK!HnHTUmolib-0.2.0.dist-info/WHEELPK!Hѱە=molib-0.2.0.dist-info/METADATAPK!HbfSqmolib-0.2.0.dist-info/RECORDPK