diff --git a/packages/python/plotly/plotly/io/_base_renderers.py b/packages/python/plotly/plotly/io/_base_renderers.py
index f5aec7e61cd..26a0fbefde2 100644
--- a/packages/python/plotly/plotly/io/_base_renderers.py
+++ b/packages/python/plotly/plotly/io/_base_renderers.py
@@ -524,7 +524,10 @@ class IFrameRenderer(MimetypeRenderer):
     Note that the HTML files in `iframe_figures/` are numbered according to
     the IPython cell execution count and so they will start being overwritten
     each time the kernel is restarted.  This directory may be deleted whenever
-    the kernel is restarted and it will be automatically recreated.
+    the kernel is restarted and it will be automatically recreated. If a cell
+    contains multiple plots, a second index is appended to the file name. For
+    example, figure_8_2.html would be the third figure in the eighth cell
+    executed.
 
     mime type: 'text/html'
     """
@@ -545,6 +548,8 @@ def __init__(
         self.animation_opts = animation_opts
         self.include_plotlyjs = include_plotlyjs
         self.html_directory = html_directory
+        self.last_focus_cell = None
+        self.last_focus_cell_output_ct = 1
 
     def to_mimebundle(self, fig_dict):
         from plotly.io import write_html
@@ -608,8 +613,17 @@ def to_mimebundle(self, fig_dict):
     def build_filename(self):
         ip = IPython.get_ipython() if IPython else None
         cell_number = list(ip.history_manager.get_tail(1))[0][1] + 1 if ip else 0
-        filename = "{dirname}/figure_{cell_number}.html".format(
-            dirname=self.html_directory, cell_number=cell_number
+        if self.last_focus_cell == cell_number:
+            output_ct_suffix = f"_{self.last_focus_cell_output_ct}"
+            self.last_focus_cell_output_ct += 1
+        else:
+            self.last_focus_cell = cell_number
+            self.last_focus_cell_output_ct = 1
+            output_ct_suffix = ""
+        filename = "{dirname}/figure_{cell_number}{output_ct_suffix}.html".format(
+            dirname=self.html_directory,
+            cell_number=cell_number,
+            output_ct_suffix=output_ct_suffix,
         )
         return filename