<commit_before>from matplotlib.colors import LinearSegmentedColormap
from matplotlib.ticker import FuncFormatter
from matplotlib import ticker
import numpy as np
###

blue = np.array([0.,13.,120.])/255.
orange = np.array([255.,102.,0.])/255.
green = np.array([9.,84.,0.])/255.
purple = np.array([138.,0.,84.])/255.
yellow = np.array([184.,159.,0.])/255.
turques = np.array([0.,204.,214.])/255.
red = np.array([120.,17.,0.])/255.

color_cycle = [blue,orange,green,purple,yellow,turques,red]


def setRcParams_fontsize(plt, style='paper'):
    textsizescale_paper = 2.
    textsizescale_talk = 2.5
    if style == 'paper':
        plt.rcParams['font.size'] = plt.rcParams['figure.figsize'][0]*textsizescale_paper 
    if style == 'talk':
        plt.rcParams['font.size'] = plt.rcParams['figure.figsize'][0]*textsizescale_talk <commit_msg>new: set_plot_size_aspect<commit_after>from matplotlib.colors import LinearSegmentedColormap
from matplotlib.ticker import FuncFormatter
from matplotlib import ticker
import numpy as np
###

blue = np.array([0.,13.,120.])/255.
orange = np.array([255.,102.,0.])/255.
green = np.array([9.,84.,0.])/255.
purple = np.array([138.,0.,84.])/255.
yellow = np.array([184.,159.,0.])/255.
turques = np.array([0.,204.,214.])/255.
red = np.array([120.,17.,0.])/255.

color_cycle = [blue,orange,green,purple,yellow,turques,red]

def set_plot_size_aspect(a, aspect = 1):
    """instead of adjusting the plot to the data, this will actually make the plot size to the wanted aspect, e.g. 1 is
    a sqare

    Parameters
    ----------
    a: matplotlib.axes._subplots.AxesSubplot instance
    asp: int,float"""

    x0,x1 = a.get_xlim()
    y0,y1 = a.get_ylim()
    a.set_aspect(aspect * (abs(x1-x0)/abs(y1-y0)))
    return

def setRcParams_fontsize(plt, style='paper'):
    textsizescale_paper = 2.
    textsizescale_talk = 2.5
    if style == 'paper':
        plt.rcParams['font.size'] = plt.rcParams['figure.figsize'][0]*textsizescale_paper 
    if style == 'talk':
        plt.rcParams['font.size'] = plt.rcParams['figure.figsize'][0]*textsizescale_talk 
{'fraction_non_alphanumeric': 0.18133718133718132, 'fraction_numerical': 0.07118807118807119, 'mean_word_length': 3.9406175771971497, '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': '5595946', 'n_tokens_mistral': 884, 'n_tokens_neox': 769, 'n_words': 140}