Skip to content

Commit e0f0abd

Browse files
committed
fixup
1 parent 98d95b8 commit e0f0abd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PlotsBase/src/arg_desc.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const _arg_desc = KW(
8383
Example: `pgfplotsx(); scatter(1:5, extra_kwargs=Dict(:subplot=>Dict("axis line shift" => "10pt"))`."""),
8484
:fontfamily => (Union{AStr,Symbol}, "Default font family for title, legend entries, tick labels and guides."),
8585
:warn_on_unsupported => (Bool, "Warn on unsupported attributes, series types and marker shapes."),
86-
:safe_saving => (Bool, "Do not override existing files when saving to disk. Choose from (true, false)"),
86+
:safe_saving => (Bool, "Do not override existing files when saving to disk. Choose from (true, false), i.e. `plot(rand(10), safe_saving=false)` for enable file overriding"),
8787

8888
# subplot args
8989
:title => (AStr, "Subplot title."),

PlotsBase/src/output.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ file types, some also support svg, ps, eps, html and tex.
138138
"""
139139
function savefig(plt::Plot, fn) # fn might be an `AbstractString` or an `AbstractPath` from `FilePaths.jl`
140140
fn = abspath(expanduser(fn))
141-
if isfile(fn)
142-
@warn "Filename $fn already exist, defaulting to omit overriding. To disable this behavior, provide `:safe_saving=false` kwarg."
141+
if isfile(fn) && plt[:safe_saving]
142+
@warn "Filename $fn already exists, defaulting to prevent overriding. To disable this behavior, provide `:safe_saving=false` kwarg, i.e. `plot(rand(10), safe_saving=false)`"
143143
return
144144
end
145145
# get the extension

0 commit comments

Comments
 (0)