Repository: wright-group/WrightTools

Issue:
Add kwargs to set_fig_labels to allow non-first-column and non-last-row to be the labeled row and column
example syntax: `wt.artists.set_fig_labels(col=0, row=-1)`


Discussion:
Possibly helpful: https://matplotlib.org/_modules/matplotlib/axes/_subplots.html#SubplotBase.is_first_col
Maybe we should also add functionality to ignore certain rows or columns for the removal of tick labels and axis labels.
registering my vote behind slice syntax
See also #139 

Resolving patch:
diff --git a/WrightTools/artists/_helpers.py b/WrightTools/artists/_helpers.py
--- a/WrightTools/artists/_helpers.py
+++ b/WrightTools/artists/_helpers.py
@@ -913,6 +913,8 @@ def set_fig_labels(
     xticks=None,
     yticks=None,
     title=None,
+    row=-1,
+    col=0,
     label_fontsize=18,
     title_fontsize=20,
 ):
@@ -934,9 +936,13 @@ def set_fig_labels(
         yticks. If False, ticks are hidden. Default is None.
     title : None or string (optional)
         Title of figure. Default is None.
-    label_fontsize : number
+    row : integer or slice (optional)
+        Row to label. Default is -1. If slice, step is ignored.
+    col : integer or slice (optional)
+        col to label. Default is 0. If slice, step is ignored.
+    label_fontsize : number (optional)
         Fontsize of label. Default is 18.
-    title_fontsize : number
+    title_fontsize : number (optional)
         Fontsize of title. Default is 20.
 
     See Also
@@ -946,32 +952,31 @@ def set_fig_labels(
     # get fig
     if fig is None:
         fig = plt.gcf()
+    # interpret row
+    numRows = fig.axes[0].numRows
+    if isinstance(row, int):
+        row %= numRows
+        row = slice(0, row)
+    row_start, row_stop, _ = row.indices(numRows)
+    # interpret col
+    numCols = fig.axes[0].numCols
+    if isinstance(col, int):
+        col %= numCols
+        col = slice(col, -1)
+    col_start, col_stop, _ = col.indices(numCols)
     # axes
     for ax in fig.axes:
         if ax.is_sideplot:
             continue
-        elif ax.is_first_col() and ax.is_last_row():
-            # lower left corner
-            set_ax_labels(
-                ax=ax,
-                xlabel=xlabel,
-                ylabel=ylabel,
-                xticks=xticks,
-                yticks=yticks,
-                label_fontsize=label_fontsize,
-            )
-        elif ax.is_first_col():
-            # lefthand column
-            set_ax_labels(
-                ax=ax, ylabel=ylabel, xticks=False, yticks=yticks, label_fontsize=label_fontsize
-            )
-        elif ax.is_last_row():
-            # bottom row
-            set_ax_labels(
-                ax=ax, xlabel=xlabel, xticks=xticks, yticks=False, label_fontsize=label_fontsize
-            )
-        else:
-            set_ax_labels(ax=ax, xticks=False, yticks=False)
+        if row_start <= ax.rowNum <= row_stop and col_start <= ax.colNum <= col_stop:
+            if ax.colNum == col_start:
+                set_ax_labels(ax=ax, ylabel=ylabel, yticks=yticks, label_fontsize=label_fontsize)
+            else:
+                set_ax_labels(ax=ax, ylabel="", yticks=False)
+            if ax.rowNum == row_stop:
+                set_ax_labels(ax=ax, xlabel=xlabel, xticks=xticks, label_fontsize=label_fontsize)
+            else:
+                set_ax_labels(ax=ax, xlabel="", xticks=False)
     # title
     if title is not None:
         fig.suptitle(title, fontsize=title_fontsize)


Test patch: