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