Toolbar "Close" button

I recommend removing the "Close the Figure" button from the toolbar.
It just destroys the widget / exits the program, which you can already
do by clicking the close button that the window manager provides.

The GNOME Human Interface Guidelines, Chapter 5 Toolbars, says
"Don't add buttons for Help, Close or Quit to your toolbar by default,
as these are rarely used and the space is better used for more useful

This reference is for GNOME/GTK+ applications and other windowing
environments will have their own guidelines, but I think they agree that
Close/Quit buttons on toolbars are not needed.

Check your own system - run some applications you use that have toolbars
and check if there is a quit button, and even if there is would it cause
a problem if it wasn't there?