viz
determine_layout(nb_axes)
Returns the optimal number of rows and columns for a bar plot.
Parameters
nb_axes : Number of axes to plot.
Returns
num_rows : Number of rows.
num_cols : Number of columns.
flexible_barplot(df, nb_axes, output, cmap=‘magma’, title=‘Barplot’, xlabel=None, ylabel=None)
Function to generate a bar plot with multiple axes in a publication-ready style.
Parameters
values : Dataframe with the values to plot. The index represents the x-axis and the columns the y-axis.
num_axes : Number of axes to plot.
output : Output filename.
cmap : Name of the colormap to use. Defaults to “magma”. See https://matplotlib.org/stable/tutorials/colors/colormaps.html
title : Title of the plot.
xlabel : Label for the x-axis.
ylabel : Label for the y-axis.
flexible_hist(df, output, cmap=‘magma’, title=‘Histogram’, xlabel=None, ylabel=None)
Function to generate a single histogram representing the distributions of all the columns within the dataset in a publication-ready style.
Parameters
df : Dataframe containing the values to plot.
output : Output filename.
cmap : Colormap. Defaults to “magma”. See https://matplotlib.org/stable/tutorials/colors/colormaps.html
title : Title of the plot. Defaults to “Histogram”.
generate_coef_plot(df, pval, coefname, varname, output, cmap=‘magma’)
Function to generate a bar plot with the coefficients and their significance.
Parameters
df : Dataframe containing the coefficients and their associated variable names.
coefname : Name of the column containing the coefficients.
varname : Name of the column containing the variable names.
output : Output filename.
cmap : Name of the colormap to use. Defaults to “magma”. See https://matplotlib.org/stable/tutorials/colors/colormaps.html