From c73a5aaabcd82a5733ab95ab54d0a1d162c7f5a0 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 7 Aug 2020 12:45:50 +0200 Subject: [PATCH] fix saving as .tikz (#2901) --- src/output.jl | 2 +- test/test_pgfplotsx.jl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/output.jl b/src/output.jl index e448d3ac..e2eb5185 100644 --- a/src/output.jl +++ b/src/output.jl @@ -112,7 +112,7 @@ function savefig(plt::Plot, fn::AbstractString) fn = abspath(expanduser(fn)) # get the extension - fn, ext = splitext(fn) + _, ext = splitext(fn) ext = chop(ext, head = 1, tail = 0) if isempty(ext) ext = defaultOutputFormat(plt) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index 2d797b7e..ed408ad5 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -302,6 +302,11 @@ end lines = readlines(io) @test count(s -> occursin("node", s), lines) == 9 end + # test .tikz extension + file_path =joinpath(path,"annotations.tikz") + @test_nowarn savefig(annotation_plot, file_path) + @test_nowarn open(file_path) do io + end end end # testset @testset "Ribbon" begin