@@ -732,7 +732,7 @@ def ptable_heatmap(
732
732
# Figure-scope
733
733
on_empty : Literal ["hide" , "show" ] = "hide" ,
734
734
hide_f_block : bool | Literal ["AUTO" ] = "AUTO" ,
735
- # f_block_voffset: float = 0.5 ,
735
+ f_block_voffset : float = 0 ,
736
736
plot_kwargs : dict [str , Any ] | None = None ,
737
737
# Axis-scope
738
738
ax_kwargs : dict [str , Any ] | None = None ,
@@ -779,6 +779,7 @@ def ptable_heatmap(
779
779
data. Defaults to "hide".
780
780
hide_f_block (bool | "AUTO"): Hide f-block (Lanthanum and Actinium series).
781
781
Defaults to "AUTO", meaning hide if no data is provided.
782
+ f_block_voffset (float): The vertical offset of f-block elements.
782
783
plot_kwargs (dict): Additional keyword arguments to
783
784
pass to the plt.subplots function call.
784
785
@@ -903,6 +904,7 @@ def tile_colors(
903
904
def add_child_plots ( # type: ignore[override]
904
905
self ,
905
906
* ,
907
+ # f_block_voffset: float = 0,
906
908
tick_kwargs : dict [str , Any ] | None = None ,
907
909
ax_kwargs : dict [str , Any ] | None = None ,
908
910
on_empty : Literal ["hide" , "show" ] = "hide" ,
@@ -912,6 +914,7 @@ def add_child_plots( # type: ignore[override]
912
914
TODO: make the element-loop part a decorator.
913
915
914
916
Args:
917
+ f_block_voffset (float): The vertical offset of f-block elements.
915
918
tick_kwargs (dict): Keyword arguments to pass to ax.tick_params().
916
919
ax_kwargs (dict): Keyword arguments to pass to ax.set().
917
920
on_empty ("hide" | "show"): Whether to show or hide tiles for
@@ -944,6 +947,15 @@ def add_child_plots( # type: ignore[override]
944
947
if (plot_data is None or len (plot_data ) == 0 ) and on_empty == "hide" :
945
948
continue
946
949
950
+ # TODO: offset is not working properly, even when offset is 0,
951
+ # the tile size still changes
952
+
953
+ # # Apply vertical offset for f-block
954
+ # if element.is_lanthanoid or element.is_actinoid:
955
+ # pos = ax.get_position()
956
+ # ax.set_position([pos.x0, pos.y0 + f_block_voffset,
957
+ # pos.width, pos.height])
958
+
947
959
# Add child heatmap plot
948
960
ax .pie (
949
961
np .ones (1 ),
@@ -1038,6 +1050,7 @@ def add_elem_values(
1038
1050
colormap = colormap , # type: ignore[arg-type]
1039
1051
plot_kwargs = plot_kwargs , # type: ignore[arg-type]
1040
1052
hide_f_block = hide_f_block , # type: ignore[arg-type]
1053
+ f_block_voffset = f_block_voffset , # type: ignore[arg-type]
1041
1054
)
1042
1055
1043
1056
# Call child plotter: heatmap
0 commit comments