@@ -2220,7 +2220,7 @@ def get_default_filename(self):
2220
2220
# Characters to be avoided in a NT path:
2221
2221
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
2222
2222
# plus ' '
2223
- removed_chars = r '<>:"/\|?*\0 '
2223
+ removed_chars = '<>:"/\ \ |?*\0 '
2224
2224
default_basename = default_basename .translate (
2225
2225
{ord (c ): "_" for c in removed_chars })
2226
2226
default_filetype = self .get_default_filetype ()
@@ -2730,23 +2730,24 @@ def resize(self, w, h):
2730
2730
"""For GUI backends, resize the window (in physical pixels)."""
2731
2731
2732
2732
def get_window_title (self ):
2733
- """
2734
- Return the title text of the window containing the figure, or None
2735
- if there is no window (e.g., a PS backend).
2736
- """
2737
- return 'image'
2733
+ """Return the title text of the window containing the figure."""
2734
+ return self ._window_title
2738
2735
2739
2736
def set_window_title (self , title ):
2740
2737
"""
2741
2738
Set the title text of the window containing the figure.
2742
2739
2743
- This has no effect for non-GUI (e.g., PS) backends.
2744
-
2745
2740
Examples
2746
2741
--------
2747
2742
>>> fig = plt.figure()
2748
2743
>>> fig.canvas.manager.set_window_title('My figure')
2749
2744
"""
2745
+ # This attribute is not defined in __init__ (but __init__ calls this
2746
+ # setter), as derived classes (real GUI managers) will store this
2747
+ # information directly on the widget; only the base (non-GUI) manager
2748
+ # class needs a specific attribute for it (so that filename escaping
2749
+ # can be checked in the test suite).
2750
+ self ._window_title = title
2750
2751
2751
2752
2752
2753
cursors = tools .cursors
0 commit comments