From 3139f2d3a97e16a2a5ab3e82e5ec87ff2b589f4d Mon Sep 17 00:00:00 2001 From: Grant Hecht Date: Tue, 21 Feb 2023 19:25:48 -0500 Subject: [PATCH] Fixed problem with saving temporary figures on windows. --- src/utils/plots.jl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/utils/plots.jl b/src/utils/plots.jl index 700513d..a3cc53c 100644 --- a/src/utils/plots.jl +++ b/src/utils/plots.jl @@ -877,13 +877,23 @@ function save_figure( tight_layout_applied = false # reset else filename = split(filename, "/")[end] # Get just the name - plt.savefig( - @sprintf("/tmp/%s", filename), - bbox_inches = "tight", - pad_inches = 0.01, - facecolor = facecolor, - dpi = dpi, - ) + if Sys.iswindows() + plt.savefig( + "C:\\Users\\" * ENV["USERNAME"] * "\\AppData\\Local\\Temp\\" * filename, + bbox_inches = "tight", + pad_inches = 0.01, + facecolor = facecolor, + dpi = dpi, + ) + else + plt.savefig( + @sprintf("/tmp/%s", filename), + bbox_inches = "tight", + pad_inches = 0.01, + facecolor = facecolor, + dpi = dpi, + ) + end end return nothing