Changelog
Version 0.0.5
Ensure Consistent Font Size and Text Wrapping Across Plot Elements
This PR addresses inconsistencies in font sizes and text wrapping across various plot elements in the stacked_crosstab_plot function. The following updates have been implemented to ensure uniformity and improve the readability of plots:
Title Font Size and Text Wrapping: - Added a
text_wrapparameter to control the wrapping of plot titles. - Ensured that title font sizes are consistent with axis label font sizes by explicitly setting the font size usingax.set_title()after plot generation.Legend Font Size Consistency: - Incorporated
label_fontsizeinto the legend font size by directly setting the font size of the legend text usingplt.setp(legend.get_texts(), fontsize=label_fontsize). - This ensures that the legend labels are consistent with the title and axis labels.
Testing
Verified that titles now wrap correctly and match the specified
label_fontsize.Confirmed that legend text scales according to
label_fontsize, ensuring consistent font sizes across all plot elements.
Version 0.0.4
Stable release
No new updates to the codebase.
Updated the project
descriptionvariable insetup.pyto re-emphasize key elements of the library.Minor README cleanup:
Added icons for sections that did not have them.
Version 0.0.3
Stable release
Updated logo size, fixed citation title, and made minor README cleanup:
Added an additional section for documentation, cleaned up verbiage, moved acknowledgments section before licensing and support.
Version 0.0.2
- First stable release
No new updates to the codebase; minimal documentation updates to README and
setup.pyfiles.Added logo, badges, and Zenodo-certified citation to README.
Version 0.0.1rc0
No new updates to the codebase; minimal documentation updates to README and
setup.pyfiles.
Version 0.0.1b0
New Scatter Fit Plot and Additional Updates
Added new
scatter_fit_plot(), removed unuseddata_types(), and added comment section headers.
Added xlim and ylim Inputs to KDE Distribution
kde_distribution():Added
xlimandyliminputs to allow users to customize axes limits inkde_distribution().
Added xlim and ylim Params to Stacked Crosstab Plot
stacked_crosstab_plot():Added
xlimandyliminput parameters tostacked_crosstab_plot()to give users more flexibility in controlling axes limits.
Added x and y Limits to Box and Violin Plots
box_violin_plot():Changed function name from
metrics_box_violin()tobox_violin_plot().Added
xlimandyliminputs to control x and y-axis limits ofbox_violin_plot()(formerlymetrics_box_violin).
Added Ability to Remove Stacks from Plots, Plot All or One at a Time
Key Changes
Plot Type Parameter -
plot_type: This parameter allows the user to choose between"regular","normalized", or"both"plot types.Remove Stacks Parameter -
remove_stacks: This parameter, when set toTrue, generates a regular bar plot using only thecolparameter instead of a stacked bar plot. It only works whenplot_typeis set to “regular”. Ifremove_stacksis set toTruewhileplot_typeis anything other than “regular”, the function will raise an exception.
Explanation of Changes
Plot Type Parameter
Provides flexibility to the user, allowing specification of the type of plot to generate:
"regular": Standard bar plot."normalized": Normalized bar plot."both": Both regular and normalized bar plots.
Remove Stacks Parameter -
remove_stacks: Generates a regular bar plot using only thecolparameter, removing the stacking of the bars. Applicable only whenplot_typeis set to “regular”. An exception is raised if used with any otherplot_type.
These changes enhance the flexibility and functionality of the stacked_crosstab_plot function, allowing for more customizable and specific plot generation based on user requirements.
Version 0.0.1b0
Refined KDE Distributions
Key Changes
Alpha Transparency for Histogram Fill - Added a
fill_alphaparameter to control the transparency of the histogram bars’ fill color. - Default value is0.6. An exception is raised iffill=Falseandfill_alphais specified.Custom Font Sizes - Introduced
label_fontsizeandtick_fontsizeparameters to control font size of axis labels and tick marks independently.Scientific Notation Toggle - Added a
disable_sci_notationparameter to enable or disable scientific notation on axes.Improved Error Handling - Added validation for the
statparameter to ensure valid options are accepted. - Added checks for proper usage offill_alphaandhist_edgecolorwhenfillis set toFalse.General Enhancements - Updated the function’s docstring to reflect new parameters and provide comprehensive guidance on usage.
Version 0.0.1b0
Enhanced KDE Distributions Function
Added Parameters
Grid Figsize and Single Figsize - Control the size of the overall grid figure and individual figures separately.
Hist Color and KDE Color` - Allow customization of histogram and KDE plot colors.
Edge Color - Allows customization of histogram bar edges.
Hue - Allows grouping data by a column.
Fill - Controls whether to fill histogram bars with color.
Y-axis Label` - Customizable y-axis label.
Log-Scaling - Specifies which variables to apply log scale.
Bins and Bin Width - Control the number and width of bins.
``stat``: - Allows different statistics for the histogram (
count,density,frequency,probability,proportion,percent).
Improvements
Validation and Error Handling - Checks for invalid
log_scale_varsand throws aValueErrorif any are found. - Throws aValueErrorifedgecoloris changed whilefillis set toFalse. - Issues aPerformanceWarningif bothbinsandbinwidthare specified, warning of potential performance impacts.Customizable Y-Axis Label - Allows users to specify custom y-axis labels.
Warning for KDE with Count - Issues a warning if KDE is used with
stat='count', as it may produce misleading plots.
Updated Function to Ensure Unique IDs and Index Check
Ensured that each generated ID in
add_idsstarts with a non-zero digit.Added a check to verify that the DataFrame index is unique.
Printed a warning message if duplicate index entries are found.
These changes improve the robustness of the function, ensuring that the IDs generated are always unique and valid, and provide necessary feedback when the DataFrame index is not unique.
Check for Unique Indices - Before generating IDs, the function now checks if the DataFrame index is unique. - If duplicates are found, a warning is printed along with the list of duplicate index entries.
Generate Non-Zero Starting IDs
The ID generation process is updated to ensure that the first digit of each ID is always non-zero.
Ensure Unique IDs
A set is used to store the generated IDs, ensuring all IDs are unique before adding them to the DataFrame.
Fix Int Conversion for Numeric Columns, Reset Decimal Places
Fixed integer conversion issue for numeric columns when
decimal_places=0in thesave_dataframes_to_excelfunction.Reset
decimal_placesdefault value to0.
These changes ensure correct formatting and avoid errors during conversion.
Contingency Table Updates
Error Handling for Columns - Added a check to ensure at least one column is specified. - Updated the function to accept a single column as a string or multiple columns as a list. - Raised a
ValueErrorif no columns are provided or ifcolsis not correctly specified.Function Parameters - Changed parameters from
col1andcol2to a single parametercolswhich can be either a string or a list.Error Handling - Renamed
SortBytosort_byto standardize nomenclature. - Added a check to ensuresort_byis either 0 or 1. - Raised aValueErrorifsort_byis not 0 or 1.
Sorting Logic - Updated the sorting logic to handle the new
colsparameter structure.Handling Categorical Data - Modified code to convert categorical columns to strings to avoid issues with
fillna("").Handling Missing Values - Added
df = df.fillna('')to fill NA values within the function to account for missing data.Improved Function Documentation - Updated function documentation to reflect new parameters and error handling.
Version 0.0.1b0
Contingency Table Updates
fillna('')added to output so that null values come through, removed'All'column name from output, sort options0and1, updated docstring documentation. Tested successfully onPython 3.7.3.
Compatibility Enhancement
Added a version check for
Python 3.7and above.Conditional import of
datetimeto handle different Python versions.
if sys.version_info >= (3, 7):
from datetime import datetime
else:
import datetime