dsci_524_ezplot.plot_histogram ============================== .. py:module:: dsci_524_ezplot.plot_histogram Functions --------- .. autoapisummary:: dsci_524_ezplot.plot_histogram.plot_histogram Module Contents --------------- .. py:function:: plot_histogram(df, column=None, bins=10, title=None, xlabel=None, ylabel=None, color=None) Create a histogram for numeric data or a bar plot for categorical data from a pandas DataFrame or a NumPy array. :param df: Input data containing the values to plot. :type df: pandas.DataFrame or numpy.ndarray :param column: Column name for the values to plot in the histogram/bar plot (only applicable for DataFrame). If None, all columns will be used (only for DataFrame input with numeric data). :type column: str or None, optional :param bins: Number of bins for the histogram. Default is 10 (ignored for categorical data). :type bins: int, optional :param title: Title of the plot. If None, no title is added. :type title: str, optional :param xlabel: Label for the x-axis. If None, no label is added. :type xlabel: str, optional :param ylabel: Label for the y-axis. If None, no label is added. :type ylabel: str, optional :param color: Color for the bars in the plot. Default is None (Matplotlib default colors are used). :type color: str or list, optional :returns: - matplotlib.figure.Figure The figure object containing the plot. - matplotlib.axes.Axes The axes object containing the plot elements. :rtype: tuple :raises TypeError: If input data is not a DataFrame or a NumPy array. :raises ValueError: If the data is empty or contains all NaN values. If `bins` is not a positive integer.