diff --git a/IPython/extensions/rmagic.py b/IPython/extensions/rmagic.py index 1fdfa95..9fc1a0f 100644 --- a/IPython/extensions/rmagic.py +++ b/IPython/extensions/rmagic.py @@ -512,7 +512,7 @@ class RMagics(Magics): # execute the R code in a temporary directory tmpd = tempfile.mkdtemp() - self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd, png_args)) + self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd.replace('\\', '/'), png_args)) text_output = '' if line_mode: