@@ -2220,7 +2220,7 @@ def get_default_filename(self):
22202220 # Characters to be avoided in a NT path:
22212221 # https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
22222222 # plus ' '
2223- removed_chars = r '<>:"/\|?*\0 '
2223+ removed_chars = '<>:"/\ \ |?*\0 '
22242224 default_basename = default_basename .translate (
22252225 {ord (c ): "_" for c in removed_chars })
22262226 default_filetype = self .get_default_filetype ()
@@ -2730,23 +2730,24 @@ def resize(self, w, h):
27302730 """For GUI backends, resize the window (in physical pixels)."""
27312731
27322732 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
27382735
27392736 def set_window_title (self , title ):
27402737 """
27412738 Set the title text of the window containing the figure.
27422739
2743- This has no effect for non-GUI (e.g., PS) backends.
2744-
27452740 Examples
27462741 --------
27472742 >>> fig = plt.figure()
27482743 >>> fig.canvas.manager.set_window_title('My figure')
27492744 """
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
27502751
27512752
27522753cursors = tools .cursors
0 commit comments