From ed45d1e02fbbd0ea0dc0862eb8a404652f747515 Mon Sep 17 00:00:00 2001
From: Thomas Walter
Date: Thu, 10 May 2018 22:48:22 +0200
Subject: [PATCH 1/2] Enable the output shortcuts 'svg', 'pdf', 'ps', 'eps'.
---
src/Plots.jl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/Plots.jl b/src/Plots.jl
index ea7ff92d..fb26477f 100644
--- a/src/Plots.jl
+++ b/src/Plots.jl
@@ -62,8 +62,13 @@ export
ylims,
zlims,
+ # output.jl
savefig,
png,
+ svg,
+ pdf,
+ ps,
+ eps,
gui,
inline,
closeall,
From bbd3a4f92ffe34575f03c56b58e4e6e46d301a45 Mon Sep 17 00:00:00 2001
From: Thomas Walter
Date: Wed, 23 May 2018 22:14:05 +0200
Subject: [PATCH 2/2] 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.
---
src/Plots.jl | 9 +++++----
src/output.jl | 10 ++++++++++
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/Plots.jl b/src/Plots.jl
index fb26477f..e8db3eb3 100644
--- a/src/Plots.jl
+++ b/src/Plots.jl
@@ -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,
diff --git a/src/output.jl b/src/output.jl
index 3932d94b..2ee44d75 100644
--- a/src/output.jl
+++ b/src/output.jl
@@ -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")