diff --git a/pymatviz/histogram.py b/pymatviz/histogram.py index 46788234..64333164 100644 --- a/pymatviz/histogram.py +++ b/pymatviz/histogram.py @@ -55,7 +55,7 @@ def elements_hist( Args: formulas (list[str]): compositional strings, e.g. ["Fe2O3", "Bi2Te3"]. count_mode ("composition" | "fractional_composition" | "reduced_composition"): - Reduce or normalize compositions before counting. See count_elements() for + Reduce or normalize compositions before counting. See `count_elements` for details. Only used when formulas is list of composition strings/objects. log (bool, optional): Whether y-axis is log or linear. Defaults to False. keep_top (int | None): Display only the top n elements by prevalence. diff --git a/pymatviz/ptable/ptable_matplotlib.py b/pymatviz/ptable/ptable_matplotlib.py index 0a55c656..300d8e14 100644 --- a/pymatviz/ptable/ptable_matplotlib.py +++ b/pymatviz/ptable/ptable_matplotlib.py @@ -377,7 +377,7 @@ def ptable_heatmap_ratio( --- Data preprocessing --- count_mode ("composition" | "fractional_composition" | "reduced_composition"): - Reduce or normalize compositions before counting. See count_elements() for + Reduce or normalize compositions before counting. See `count_elements` for details. Only used when values is list of composition strings/objects. normalize (bool): Whether to normalize heatmap values so they sum to 1. Makes different ptable_heatmap_ratio plots comparable. Defaults to False. @@ -418,8 +418,8 @@ def ptable_heatmap_ratio( plt.Figure: matplotlib Figure object. """ # Generate ratio data - values_num = count_elements(values_num, count_mode) - values_denom = count_elements(values_denom, count_mode) + values_num = count_elements(values_num, count_mode, fill_value=0) + values_denom = count_elements(values_denom, count_mode, fill_value=0) values = values_num / values_denom