<commit_before>
import matplotlib.pyplot as plt
import pylab as pl
    
import numpy as np


################################################################### matrices #######################################################

def plot_cormat(plot_file, cor_mat,list_labels = [],label_size =2):
    
    fig1 = plt.figure()
    ax = fig1.add_subplot(1,1,1)
    
    im = ax.matshow(cor_mat,interpolation="none")
    #plt.axis('off')
    
    [i.set_visible(False) for i in ax.spines.values()]
    
    #im.set_cmap('binary')
    im.set_cmap('rainbow')
    ### add labels
    
    if len(list_labels) != 0:
        
        if len(list_labels) == cor_mat.shape[0]:
            
            plt.xticks(list(range(len(list_labels))), list_labels,rotation='vertical', fontsize=label_size)
            plt.yticks(list(range(len(list_labels))), list_labels, fontsize=label_size)
            
            plt.subplots_adjust(top = 0.8)
        else:
            print("Warning in utils_plot.plot_cormat, incompatible number of labels %d and matrix shape %d" %(len(list_labels),cor_mat.shape[0]))
            
        
    plt.tick_params(axis='both',          # changes apply to the x-axis
        which='both',      # both major and minor ticks are affected
        bottom='off',      # ticks along the bottom edge are off
        top='off',         # ticks along the top edge are off
        left = 'off',
        right = 'off'
        )
    #ax.set_xticklabels(['']+labels)
    #plt.setp(ax.get_xticklabels(), rotation='vertical', fontsize=3)
    
    fig1.colorbar(im)
    
    fig1.savefig(plot_file)
    
    plt.close(fig1)
    #fig1.close()
    del fig1
    
def plot_ranged_cormat(plot_file, cor_mat,list_labels = [], fix_full_range = [-1.0,1.0],label_size = 2):
    
    fig1 = plt.figure(frameon=False)
    ax = fig1.add_subplot(1,1,1)
    
    im = ax.matshow(cor_mat,vmin = fix_full_range[0], vmax = fix_full_range[1],interpolation="none")
    #plt.axis('off')
    
    [i.set_visible(False) for i in ax.spines.values()]
    
    #im.set_cmap('binary')
    im.set_cmap('spectral')
    #im.set_cmap('jet')
    <commit_msg>corrected some matplotlib warning with 'off' -> False for ticks<commit_after>
import matplotlib.pyplot as plt
import pylab as pl
    
import numpy as np


################################################################### matrices #######################################################

def plot_cormat(plot_file, cor_mat,list_labels = [],label_size =2):
    
    fig1 = plt.figure()
    ax = fig1.add_subplot(1,1,1)
    
    im = ax.matshow(cor_mat,interpolation="none")
    #plt.axis('off')
    
    [i.set_visible(False) for i in ax.spines.values()]
    
    #im.set_cmap('binary')
    im.set_cmap('rainbow')
    ### add labels
    
    if len(list_labels) != 0:
        
        if len(list_labels) == cor_mat.shape[0]:
            
            plt.xticks(list(range(len(list_labels))), list_labels,rotation='vertical', fontsize=label_size)
            plt.yticks(list(range(len(list_labels))), list_labels, fontsize=label_size)
            
            plt.subplots_adjust(top = 0.8)
        else:
            print("Warning in utils_plot.plot_cormat, incompatible number of labels %d and matrix shape %d" %(len(list_labels),cor_mat.shape[0]))
            
        
    plt.tick_params(axis='both',          # changes apply to the x-axis
        which='both',      # both major and minor ticks are affected
        bottom=False,      # ticks along the bottom edge are off
        top=False,         # ticks along the top edge are off
        left = False,
        right = False
        )
    #ax.set_xticklabels(['']+labels)
    #plt.setp(ax.get_xticklabels(), rotation='vertical', fontsize=3)
    
    fig1.colorbar(im)
    
    fig1.savefig(plot_file)
    
    plt.close(fig1)
    #fig1.close()
    del fig1
    
def plot_ranged_cormat(plot_file, cor_mat,list_labels = [], fix_full_range = [-1.0,1.0],label_size = 2):
    
    fig1 = plt.figure(frameon=False)
    ax = fig1.add_subplot(1,1,1)
    
    im = ax.matshow(cor_mat,vmin = fix_full_range[0], vmax = fix_full_range[1],interpolation="none")
    #plt.axis('off')
    
    [i.set_visible(False) for i in ax.spines.values()]
    
    #im.set_cmap('binary')
    im.set_cmap('spectral')
    #im.set_cmap('jet')
    
{'fraction_non_alphanumeric': 0.18029739776951673, 'fraction_numerical': 0.013475836431226766, 'mean_word_length': 2.7467362924281984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2229726', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1460, 'n_words': 270}