# Path: enrich2/plots.py
# DEFAULT_BINS = 30
# DEFAULT_GRIDSIZE = 50
# def configure_axes(ax, xgrid=False):
# def fit_axes(ax, xvalues, yvalues, slope, intercept, xlabels=None):
# def fit_axes_text(ax, cornertext=None, centertext=None, centerwrap=40):
# def volcano_plot(df, pdf, title=None, colors=None, log_bins=True, logp_max=10):
# def barcodemap_plot(
#     obj, pdf, log=False, bins=DEFAULT_BINS, color=plot_colors["bright3"]
# ):
# def overlap_merge_plot(obj, pdf):
# def counts_plot(
#     seqlib, label, pdf, log=False, bins=DEFAULT_BINS, color=plot_colors["bright1"]
# ):
# def weights_plot(selection, label, pdf):
# def corr_axes(ax, x, y, score_min, score_max, **kwargs):
# def hexbin_corr_axes(
#     ax, x, y, score_min, score_max, cbar_ax=None, gridsize=50, cmap="YlGnBu_r"
# ):
# def density_ax(ax, ys, xmin, xmax, xlabel, line_params, legend_loc="best"):


import logging
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.patches import Circle
from matplotlib.lines import Line2D
from matplotlib.gridspec import GridSpec
from .plots import plot_cmaps, plot_colors
    # log transform counts if necessary
    if style == "logcounts":
        df = np.log10(df)

    # mask NaN so we can color them separately
    masked = np.ma.array(df, mask=np.isnan(df))
    if df_se is not None:
        masked_se = np.ma.array(df_se, mask=np.isnan(df_se))

    # set colors and min/max data values
    if style == "counts" or style == "logcounts":
        try:
            if colors is not None:
                cmap = plt.get_cmap(colors)
            else:
                cmap = plt.get_cmap(plot_cmaps["sequential"])
        except ValueError:
            logger.warning(
                "Invalid sequential color map choice. " "Falling back to 'BuPu'"
            )
            cmap = plt.get_cmap("BuPu")
        if vmin is None:
            vmin = 0.0
        if vmax is None:
            vmax = masked.max()
    else:  # style == "scores"
        try:
            if colors is not None:
                cmap = plt.get_cmap(colors)
            else:

# Path: enrich2/plots.py
# DEFAULT_BINS = 30
# DEFAULT_GRIDSIZE = 50
# def configure_axes(ax, xgrid=False):
# def fit_axes(ax, xvalues, yvalues, slope, intercept, xlabels=None):
# def fit_axes_text(ax, cornertext=None, centertext=None, centerwrap=40):
# def volcano_plot(df, pdf, title=None, colors=None, log_bins=True, logp_max=10):
# def barcodemap_plot(
#     obj, pdf, log=False, bins=DEFAULT_BINS, color=plot_colors["bright3"]
# ):
# def overlap_merge_plot(obj, pdf):
# def counts_plot(
#     seqlib, label, pdf, log=False, bins=DEFAULT_BINS, color=plot_colors["bright1"]
# ):
# def weights_plot(selection, label, pdf):
# def corr_axes(ax, x, y, score_min, score_max, **kwargs):
# def hexbin_corr_axes(
#     ax, x, y, score_min, score_max, cbar_ax=None, gridsize=50, cmap="YlGnBu_r"
# ):
# def density_ax(ax, ys, xmin, xmax, xlabel, line_params, legend_loc="best"):


# Path: enrich2/sfmap.py
import logging
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.patches import Circle
from matplotlib.lines import Line2D
from matplotlib.gridspec import GridSpec
from .plots import plot_cmaps, plot_colors

    # log transform counts if necessary
    if style == "logcounts":
        df = np.log10(df)

    # mask NaN so we can color them separately
    masked = np.ma.array(df, mask=np.isnan(df))
    if df_se is not None:
        masked_se = np.ma.array(df_se, mask=np.isnan(df_se))

    # set colors and min/max data values
    if style == "counts" or style == "logcounts":
        try:
            if colors is not None:
                cmap = plt.get_cmap(colors)
            else:
                cmap = plt.get_cmap(plot_cmaps["sequential"])
        except ValueError:
            logger.warning(
                "Invalid sequential color map choice. " "Falling back to 'BuPu'"
            )
            cmap = plt.get_cmap("BuPu")
        if vmin is None:
            vmin = 0.0
        if vmax is None:
            vmax = masked.max()
    else:  # style == "scores"
        try:
            if colors is not None:
                cmap = plt.get_cmap(colors)
            else:

                cmap = plt.get_cmap(plot_cmaps["diverging"])