Undo export of 'svg', 'pdf', 'ps', 'eps'. too common short words.

Implement and export the output shortcuts 'save_svg', 'save_pdf', 'save_ps', 'save_eps'.

Think about: Extend the function names with prefix 'plots_' to make it much more unique.
This commit is contained in:
Thomas Walter 2018-05-23 22:14:05 +02:00
parent ed45d1e02f
commit bbd3a4f92f
2 changed files with 15 additions and 4 deletions

View File

@ -65,10 +65,11 @@ export
# output.jl
savefig,
png,
svg,
pdf,
ps,
eps,
save_png,
save_svg,
save_pdf,
save_ps,
save_eps,
gui,
inline,
closeall,

View File

@ -9,6 +9,8 @@ function png(plt::Plot, fn::AbstractString)
close(io)
end
png(fn::AbstractString) = png(current(), fn)
save_png(plt::Plot, fn::AbstractString) = png(plt::Plot, fn::AbstractString)
save_png(fn::AbstractString) = png(current(), fn)
function svg(plt::Plot, fn::AbstractString)
fn = addExtension(fn, "svg")
@ -17,6 +19,8 @@ function svg(plt::Plot, fn::AbstractString)
close(io)
end
svg(fn::AbstractString) = svg(current(), fn)
save_svg(plt::Plot, fn::AbstractString) = svg(plt::Plot, fn::AbstractString)
save_svg(fn::AbstractString) = svg(current(), fn)
function pdf(plt::Plot, fn::AbstractString)
@ -26,6 +30,8 @@ function pdf(plt::Plot, fn::AbstractString)
close(io)
end
pdf(fn::AbstractString) = pdf(current(), fn)
save_pdf(plt::Plot, fn::AbstractString) = pdf(plt::Plot, fn::AbstractString)
save_pdf(fn::AbstractString) = pdf(current(), fn)
function ps(plt::Plot, fn::AbstractString)
@ -35,6 +41,8 @@ function ps(plt::Plot, fn::AbstractString)
close(io)
end
ps(fn::AbstractString) = ps(current(), fn)
save_ps(plt::Plot, fn::AbstractString) = ps(plt::Plot, fn::AbstractString)
save_ps(fn::AbstractString) = ps(current(), fn)
function eps(plt::Plot, fn::AbstractString)
fn = addExtension(fn, "eps")
@ -43,6 +51,8 @@ function eps(plt::Plot, fn::AbstractString)
close(io)
end
eps(fn::AbstractString) = eps(current(), fn)
save_eps(plt::Plot, fn::AbstractString) = eps(plt::Plot, fn::AbstractString)
save_eps(fn::AbstractString) = eps(current(), fn)
function tex(plt::Plot, fn::AbstractString)
fn = addExtension(fn, "tex")