Repository: spyder-ide/spyder

Issue:
Improve highlighting of current plot
 
<!---   *** BEFORE SUBMITTING: PASTE CLIPBOARD HERE TO COMPLETE YOUR REPORT ***   ---!>

Not so much a bug, but more of a request for improvement. When browsing through a large number of plots, it is barely possible to tell which plot we are currently viewing. Instead of a very thin light blue frame, I would recommend a thicker red line for emphasis. Thanks a lot!


Discussion:
Hey @meshgeneration, thanks for the suggestion. We'll try to take address it in Spyder 6, to be released before the end of the year.
I agree that it is not clear currently which plot is active, especially in dark mode:

![plots-orig-dark](https://github.com/spyder-ide/spyder/assets/7941918/d7a86e3f-855f-455a-8282-9c22956ea864)

It looks a lot better in light mode:

![plots-orig-light](https://github.com/spyder-ide/spyder/assets/7941918/93fec5e3-c225-4074-b2a4-ad13680bed21)

As suggested, I tried to change it to red, specifically `SpyderPalette.ICON_4`. Of course red normally is used to indicate an error, which is not the meaning here, so that is not ideal. However, it does make it clearer which plot is active:

![plots-red-dark](https://github.com/spyder-ide/spyder/assets/7941918/cdfbc9fe-9700-445c-ae62-5b1e58a43bab)

For comparison, here is the light mode with red:

![plots-red-light](https://github.com/spyder-ide/spyder/assets/7941918/7d593feb-4783-439e-8331-25e7937e4fbb)

I think the difficulty here is that if you use Spyder in dark mode and plots with a white background (the default in Matplotlib), then the border is between a dark colour and a light colour so it is hard to put something contrasting in with just two pixels. It naturally works better if Spyder is in light mode. Perhaps we need another mechanism to indicate the active plot, like a border on the outside around the plot instead of on the inside, or something completely different like putting an icon on top of the thumbnail of the active plot (but that would partially occlude the thumnail). I'm not sure how easy these are to implement.

@spyder-ide/core-developers @conradolandia Any preferences or ideas on how to proceed? See #10255 for some earlier discussion on the same topic. At the moment, I'm thinking to use red as a quick fix for Spyder 6 and (hopefully) discuss in more detail after Spyder 6.

Resolving patch:
diff --git a/spyder/plugins/plots/widgets/figurebrowser.py b/spyder/plugins/plots/widgets/figurebrowser.py
--- a/spyder/plugins/plots/widgets/figurebrowser.py
+++ b/spyder/plugins/plots/widgets/figurebrowser.py
@@ -1057,10 +1057,9 @@ def highlight_canvas(self, highlight):
         Set a colored frame around the FigureCanvas if highlight is True.
         """
         if highlight:
-            # Highlighted figure is not clear in dark mode with blue color.
-            # See spyder-ide/spyder#10255.
+            # See spyder-ide/spyder#21598 for choice of styling.
             self.canvas.setStyleSheet(
-                "FigureCanvas{border: 2px solid %s;}" %
+                "FigureCanvas{border: 3px solid %s;}" %
                 QStylePalette.COLOR_ACCENT_3
             )
         else:


Test patch: