Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
isentropic committed Jul 18, 2024
1 parent 98d95b8 commit e0f0abd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PlotsBase/src/arg_desc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const _arg_desc = KW(
Example: `pgfplotsx(); scatter(1:5, extra_kwargs=Dict(:subplot=>Dict("axis line shift" => "10pt"))`."""),
:fontfamily => (Union{AStr,Symbol}, "Default font family for title, legend entries, tick labels and guides."),
:warn_on_unsupported => (Bool, "Warn on unsupported attributes, series types and marker shapes."),
:safe_saving => (Bool, "Do not override existing files when saving to disk. Choose from (true, false)"),
: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"),

# subplot args
:title => (AStr, "Subplot title."),
Expand Down
4 changes: 2 additions & 2 deletions PlotsBase/src/output.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ file types, some also support svg, ps, eps, html and tex.
"""
function savefig(plt::Plot, fn) # fn might be an `AbstractString` or an `AbstractPath` from `FilePaths.jl`
fn = abspath(expanduser(fn))
if isfile(fn)
@warn "Filename $fn already exist, defaulting to omit overriding. To disable this behavior, provide `:safe_saving=false` kwarg."
if isfile(fn) && plt[:safe_saving]
@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)`"
return
end
# get the extension
Expand Down

0 comments on commit e0f0abd

Please sign in to comment.