<commit_before>import pdb
import numpy as np
import matplotlib.pyplot as plt
import fnmatch
import random
from priors import *

def plotinit():
    fig1 = plt.figure('posteriors',figsize=(8,12))
    fig2=plt.figure('hrd',figsize=(8,12))

    #plt.subplots_adjust(left=0.08, bottom=0.04, right=0.96, top=0.96, wspace=0.27, \
    #                    hspace=0.6)

    #plt.ion()
    #plt.show()

    fig1.set_tight_layout(True)
    plt.draw()
    plt.show()
    

    #plt.subplots_adjust(left=0.08, bottom=0.04, right=0.96, top=0.96, wspace=0.27, \
    #                    hspace=0.6)
    #plt.subplots_adjust(left=0.05, bottom=0.05, right=0.95, top=0.97, wspace=0.3, \
    #    hspace=0.5)

def plotclear():
#    raw_input(':')

    plt.clf()
    plt.figure('posteriors')
    plt.clf()

#def plotposterior(x,y,res,err1,err2,avs,model,model_red,names,j,medav,stdav,grcol,ricol,grcole,ricole,Mg,Mge,ix,iy):
def plotposterior(x,y,res,err1,err2,names,j,ix,iy):
    fig = plt.figure(figsize=(8,12))
    plt.subplot(len(names),2,ix)
    plt.plot(x,np.cumsum(y))
    plt.plot([res,res],[0,1],'r')
    plt.plot([res+err1,res+err1],[0,1],'--r')
    plt.plot([res-err2,res-err2],[0,1],'--r')
    plt.ylim([0,1])
    plt.title(names[j])
    if fnmatch.fnmatch(names[j],'*rho*'):
        plt.xscale('log')
    if fnmatch.fnmatch(names[j],'*lum*'):
        plt.xscale('log')


    plt.subplot(len(names),2,iy)
    plt.plot(x,y)
    plt.plot([res,res],[0,1],'r')
    plt.plot([res+err1,res+err1],[0,1],'--r')
    plt.plot([res-err2,res-err2],[0,1],'--r')
    plt.ylim([0,np.max(y)+np.max(y)*0.1])
    plt.title(names[j])
    if fnmatch.fnmatch(names[j],'*rho*'):
        plt.xscale('log')
    if fnmatch.fnmatch(names[j],'*lum*'):
        plt.xscale('log')

    if fnmatch.fnmatch(names[j],'*feh*'):
        xt=np.arange(-2.,1.,0.01)
        yt=fehprior(xt)
        plt.plot(xt,yt*np.max(y)/np.max(yt),'--g')

    '''
    if fnmatch.fnmatch(names[j],'*avs*'):
        xt=np.arange(np.min(avs),np.max(avs),0.001)
        yt=gaussian(xt,1.,medav,stdav,0.)
        #yt=avprior(xt,data,i,dust,dist)
        plt.plot(xt,yt*np.max(y)/np.max(yt),'--g')
    '''
    fig.set_tight_layout(True)

def plothrd(model,input,mabs,mabse,ix,iy):

    plt.subplots_adjust(left=0.08, bottom=0.05, right=0.96, top=0.96, wspace=0.31, \
                        hspace=0.26)

    plt.figure('hrd')
    plt.subplot(2,3,1)
    frac=0.01

    ran=np.array(random.sample(range(len(model['teff'])),\
    int(len(model['teff'])*frac)))<commit_msg>commented out tight layout<commit_after>import pdb
import numpy as np
import matplotlib.pyplot as plt
import fnmatch
import random
from priors import *

def plotinit():
    fig1 = plt.figure('posteriors',figsize=(8,12))
    fig2=plt.figure('hrd',figsize=(8,12))

    #plt.subplots_adjust(left=0.08, bottom=0.04, right=0.96, top=0.96, wspace=0.27, \
    #                    hspace=0.6)

    plt.figure('posteriors')
    plt.ion()
    plt.show()

    #fig1.set_tight_layout(True)
    #plt.draw()
    #plt.show()
    

    #plt.subplots_adjust(left=0.08, bottom=0.04, right=0.96, top=0.96, wspace=0.27, \
    #                    hspace=0.6)
    #plt.subplots_adjust(left=0.05, bottom=0.05, right=0.95, top=0.97, wspace=0.3, \
    #    hspace=0.5)

def plotclear():
    raw_input(':')

    plt.clf()
    plt.figure('posteriors')
    plt.clf()

#def plotposterior(x,y,res,err1,err2,avs,model,model_red,names,j,medav,stdav,grcol,ricol,grcole,ricole,Mg,Mge,ix,iy):
def plotposterior(x,y,res,err1,err2,names,j,ix,iy):
    #fig = plt.figure(figsize=(8,12))
    plt.subplot(len(names),2,ix)
    plt.plot(x,np.cumsum(y))
    plt.plot([res,res],[0,1],'r')
    plt.plot([res+err1,res+err1],[0,1],'--r')
    plt.plot([res-err2,res-err2],[0,1],'--r')
    plt.ylim([0,1])
    plt.title(names[j])
    if fnmatch.fnmatch(names[j],'*rho*'):
        plt.xscale('log')
    if fnmatch.fnmatch(names[j],'*lum*'):
        plt.xscale('log')


    plt.subplot(len(names),2,iy)
    plt.plot(x,y)
    plt.plot([res,res],[0,1],'r')
    plt.plot([res+err1,res+err1],[0,1],'--r')
    plt.plot([res-err2,res-err2],[0,1],'--r')
    plt.ylim([0,np.max(y)+np.max(y)*0.1])
    plt.title(names[j])
    if fnmatch.fnmatch(names[j],'*rho*'):
        plt.xscale('log')
    if fnmatch.fnmatch(names[j],'*lum*'):
        plt.xscale('log')

    if fnmatch.fnmatch(names[j],'*feh*'):
        xt=np.arange(-2.,1.,0.01)
        yt=fehprior(xt)
        plt.plot(xt,yt*np.max(y)/np.max(yt),'--g')

    '''
    if fnmatch.fnmatch(names[j],'*avs*'):
        xt=np.arange(np.min(avs),np.max(avs),0.001)
        yt=gaussian(xt,1.,medav,stdav,0.)
        #yt=avprior(xt,data,i,dust,dist)
        plt.plot(xt,yt*np.max(y)/np.max(yt),'--g')
    '''
    #fig.set_tight_layout(True)

def plothrd(model,input,mabs,mabse,ix,iy):

    plt.subplots_adjust(left=0.08, bottom=0.05, right=0.96, top=0.96, wspace=0.31, \
                        hspace=0.26)

    plt.figure('hrd')
    plt.subplot(2,3,1)
    frac=0.01

    ran=np.array(random.sample(range(len(model['teff'])),\
    int(len(model['teff'])*frac)))
{'fraction_non_alphanumeric': 0.2257617728531856, 'fraction_numerical': 0.05065294815987337, 'mean_word_length': 3.2125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2037934', 'n_tokens_mistral': 2367, 'n_tokens_neox': 2238, 'n_words': 219}