<commit_before>import numpy as np
import os

import matplotlib as mpl
mpl.use('PS')
import matplotlib.pyplot as plt

import chippr
from chippr import utils as u
from chippr import plot_utils as pu

def plot_true_histogram(true_samps, n_bins=50, plot_loc='', plot_name='true_hist.png'):
    """
    Plots a histogram of true input values

    Parameters
    ----------
    true_samps: numpy.ndarray, float
        vector of true values of scalar input
    n_bins: int, optional
        number of histogram bins in which to place input values
    plot_loc: string, optional
        location in which to store plot
    plot_name: string, optional
        filename for plot
    """
    pu.set_up_plot()
    f = plt.figure(figsize=(5, 5))
    sps = f.add_subplot(1, 1, 1)
    sps.hist(true_samps, bins=n_bins, normed=1)
    sps.set_xlabel(r'$z_{true}$')
    sps.set_ylabel(r'$n(z_{true})$')
    f.savefig(os.path.join(plot_loc, plot_name))

def plot_obs_scatter(true_samps, obs_samps, plot_loc='', plot_name='obs_scatter.png'):
    """
    Plots a scatterplot of true and observed redshift values

    Parameters
    ----------
    true_samps: numpy.ndarray, float
        vector of true values of scalar input
    obs_samps: numpy.ndarray, float
        vector of observed values of scalar input
    plot_loc: string, optional
        location in which to store plot
    plot_name: string, optional
        filename for plot
    """
    pu.set_up_plot()
    f = plt.figure(figsize=(5, 5))
    sps = f.add_subplot(1, 1, 1)
    sps.scatter(true_samps, obs_samps)
    sps.set_xlabel(r'$z_{true}$')
    sps.set_ylabel(r'$z_{obs}$')
    f.savefig(os.path.join(plot_loc, plot_name))<commit_msg>make plots slightly prettier<commit_after>import numpy as np
import os

import matplotlib as mpl
mpl.use('PS')
import matplotlib.pyplot as plt

import chippr
from chippr import utils as u
from chippr import plot_utils as pu

def plot_true_histogram(true_samps, n_bins=50, plot_loc='', plot_name='true_hist.png'):
    """
    Plots a histogram of true input values

    Parameters
    ----------
    true_samps: numpy.ndarray, float
        vector of true values of scalar input
    n_bins: int, optional
        number of histogram bins in which to place input values
    plot_loc: string, optional
        location in which to store plot
    plot_name: string, optional
        filename for plot
    """
    pu.set_up_plot()
    f = plt.figure(figsize=(5, 5))
    sps = f.add_subplot(1, 1, 1)
    sps.hist(true_samps, bins=n_bins, normed=1, color='k')
    sps.set_xlabel(r'$z_{true}$')
    sps.set_ylabel(r'$n(z_{true})$')
    f.savefig(os.path.join(plot_loc, plot_name))

def plot_obs_scatter(true_samps, obs_samps, plot_loc='', plot_name='obs_scatter.png'):
    """
    Plots a scatterplot of true and observed redshift values

    Parameters
    ----------
    true_samps: numpy.ndarray, float
        vector of true values of scalar input
    obs_samps: numpy.ndarray, float
        vector of observed values of scalar input
    plot_loc: string, optional
        location in which to store plot
    plot_name: string, optional
        filename for plot
    """
    pu.set_up_plot()
    f = plt.figure(figsize=(5, 5))
    sps = f.add_subplot(1, 1, 1)
    sps.scatter(true_samps, obs_samps, 'k.')
    sps.set_xlabel(r'$z_{true}$')
    sps.set_ylabel(r'$z_{obs}$')
    f.savefig(os.path.join(plot_loc, plot_name))
{'fraction_non_alphanumeric': 0.11176470588235295, 'fraction_numerical': 0.007647058823529412, 'mean_word_length': 3.1025331724969845, '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': '6503310', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1169, 'n_words': 322}