fix saving as .tikz (#2901)

This commit is contained in:
Simon Christ 2020-08-07 12:45:50 +02:00 committed by GitHub
parent 806d4671ce
commit c73a5aaabc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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