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