# Path: metatlas/io/write_utils.py
# def make_dir_for(file_path):
# def check_existing_file(file_path, overwrite=False):
# def export_dataframe(dataframe, file_path, description, overwrite=False, **kwargs):
# def raise_on_diff(dataframe, file_path, description, **kwargs):
# def export_dataframe_die_on_diff(dataframe, file_path, description, overwrite=False, **kwargs):
# 
# Path: metatlas/plots/utils.py
# BACKGROUND_COLORS = ["white", "lightyellow", "whitesmoke", "lavenderblush"]
# def colors() -> Generator:
# def subplot_dimensions(num: int) -> Tuple[int, int]:
# def wrap_subplots(num: int, **kwargs) -> Tuple[matplotlib.figure.Figure, List[matplotlib.axes.Axes]]:
# def is_in_range(a: List[float], start: float, stop: float) -> List[bool]:
# def fill_under(
#     ax: matplotlib.axes.Axes,
#     x: List[float],
#     y: List[float],
#     between: Optional[Tuple[float, float]] = None,
#     **kwargs,
# ) -> None:
# def pdf_with_text(text: str, file_name: str, size: int = 24):


import datetime
import logging
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
from abc import ABC
from typing import Optional, Sequence, Tuple
from matplotlib.backends.backend_pdf import PdfPages
from metatlas.io import write_utils
from metatlas.plots import utils
        """
        Draw plot on ax
        back_color: background color for plot
        """
        ax.ticklabel_format(axis="y", scilimits=[0, 0])
        ax.set_facecolor(back_color)
        ax.set_title(f"{self.title}\n{self.group_name}")


class PlotSet(ABC):
    """A Set of related plots"""

    # pylint: disable=too-few-public-methods,too-many-locals,too-many-arguments

    @restore_matplotlib_settings
    def __init__(
        self,
        plots: Sequence[Plot],
        max_plots_per_fig: int = 30,
        x_min: Optional[float] = None,
        x_max: Optional[float] = None,
        y_min: Optional[float] = None,
        y_max: Optional[float] = None,
        sharey: bool = True,
        font_scale: float = 2,
    ):
        num_plots = len(plots)
        num_pages = math.ceil(num_plots / max_plots_per_fig)
        plots_per_page = math.ceil(num_plots / num_pages)
        self.figures = []

# Path: metatlas/io/write_utils.py
# def make_dir_for(file_path):
# def check_existing_file(file_path, overwrite=False):
# def export_dataframe(dataframe, file_path, description, overwrite=False, **kwargs):
# def raise_on_diff(dataframe, file_path, description, **kwargs):
# def export_dataframe_die_on_diff(dataframe, file_path, description, overwrite=False, **kwargs):
# 
# Path: metatlas/plots/utils.py
# BACKGROUND_COLORS = ["white", "lightyellow", "whitesmoke", "lavenderblush"]
# def colors() -> Generator:
# def subplot_dimensions(num: int) -> Tuple[int, int]:
# def wrap_subplots(num: int, **kwargs) -> Tuple[matplotlib.figure.Figure, List[matplotlib.axes.Axes]]:
# def is_in_range(a: List[float], start: float, stop: float) -> List[bool]:
# def fill_under(
#     ax: matplotlib.axes.Axes,
#     x: List[float],
#     y: List[float],
#     between: Optional[Tuple[float, float]] = None,
#     **kwargs,
# ) -> None:
# def pdf_with_text(text: str, file_name: str, size: int = 24):


# Path: metatlas/plots/plot_set.py
import datetime
import logging
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
from abc import ABC
from typing import Optional, Sequence, Tuple
from matplotlib.backends.backend_pdf import PdfPages
from metatlas.io import write_utils
from metatlas.plots import utils

        """
        Draw plot on ax
        back_color: background color for plot
        """
        ax.ticklabel_format(axis="y", scilimits=[0, 0])
        ax.set_facecolor(back_color)
        ax.set_title(f"{self.title}\n{self.group_name}")


class PlotSet(ABC):
    """A Set of related plots"""

    # pylint: disable=too-few-public-methods,too-many-locals,too-many-arguments

    @restore_matplotlib_settings
    def __init__(
        self,
        plots: Sequence[Plot],
        max_plots_per_fig: int = 30,
        x_min: Optional[float] = None,
        x_max: Optional[float] = None,
        y_min: Optional[float] = None,
        y_max: Optional[float] = None,
        sharey: bool = True,
        font_scale: float = 2,
    ):
        num_plots = len(plots)
        num_pages = math.ceil(num_plots / max_plots_per_fig)
        plots_per_page = math.ceil(num_plots / num_pages)
        self.figures = []

        color_generator = utils.colors()