From ecc891279e274d0d63ec1255fa501d427b5099ab Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 14:36:24 +0100 Subject: [PATCH 01/13] fix background + fill between --- src/backends/pgfplotsx.jl | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 69c0b4b4..867da187 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -8,25 +8,21 @@ Base.@kwdef mutable struct PGFPlotsXPlot # tikz libraries PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usetikzlibrary{arrows.meta}") PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usetikzlibrary{backgrounds}") - PGFPlotsX.push_preamble!(pgfx_plot.the_plot, - """ - \\pgfkeys{/tikz/.cd, - background color/.initial=white, - background color/.get=\\backcol, - background color/.store in=\\backcol, - } - \\tikzset{background rectangle/.style={ - fill=\\backcol, - }, - use background/.style={ - show background rectangle - } - } - """ - ) # pgfplots libraries PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usepgfplotslibrary{patchplots}") PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usepgfplotslibrary{fillbetween}") + # compatibility fixes + # add background layer to standard layers + PGFPlotsX.push_preamble!(pgfx_plot.the_plot, + raw""" + \pgfplotsset{ + /pgfplots/layers/axis on top/.define layer set={ + background, axis background,pre main,main,axis grid,axis ticks,axis lines,axis tick labels, + axis descriptions,axis foreground + }{/pgfplots/layers/standard}, + } + """ + ) pgfx_plot end end @@ -73,9 +69,11 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) cstr = plot_color(bgc) a = alpha(cstr) push!(the_plot.options, - "draw opacity" => a, - "background color" => cstr, - "use background" => nothing, + "/tikz/background rectangle/.style" => PGFPlotsX.Options( + "fill" => cstr, + "draw opacity" => a, + ), + "show background rectangle" => nothing, ) end @@ -121,7 +119,8 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) ), "axis background/.style" => PGFPlotsX.Options( "fill" => sp[:background_color_inside] - ) + ), + "axis on top" => nothing, ) # legend position if sp[:legend] isa Tuple From cfe1ede25a65288534d5d1c5723b5b9bf2488ee4 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 14:40:34 +0100 Subject: [PATCH 02/13] fix ribbon --- src/backends/pgfplotsx.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 867da187..dd410bb3 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -233,7 +233,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) end if st == :shape || isfilledcontour(series) || - series[:ribbon] !== nothing + series[:ribbon] === nothing segment_opt = merge( segment_opt, pgfx_fillstyle(opt, i) ) end # add fillrange @@ -606,10 +606,11 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ribbon_y = series[:ribbon] opt = series.plotattributes if ribbon_y isa AVec - ribbon_n = length(opt[:y]) ÷ length(ribbon) - ribbon_y = repeat(ribbon, outer = ribbon_n) + ribbon_n = length(opt[:y]) ÷ length(ribbon_y) + ribbon_y = repeat(ribbon_y, outer = ribbon_n) end # upper ribbon + # TODO: use UUIDs ribbon_name_plus = "plots_rib_p$series_index" ribbon_opt_plus = merge(segment_plot.options, PGFPlotsX.Options( "name path" => ribbon_name_plus, From 84347415994f53b5299820da6650dcba8230dba7 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 14:42:35 +0100 Subject: [PATCH 03/13] add test --- test/test_pgfplotsx.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index ca033a52..0629470a 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -133,4 +133,11 @@ end annotate!([(5, y[5], Plots.text("this is \\#5", 16, :red, :center)), (10, y[10], Plots.text("this is \\#10", :right, 20, "courier"))]) scatter!(range(2, stop=8, length=6), rand(6), marker=(50, 0.2, :orange), series_annotations=["series", "annotations", "map", "to", "series", Plots.text("data", :green)]) end # testset -end # testset + @testset "Ribbon" begin + aa = rand(10) + bb = rand(10) + cc = rand(10) + conf = [aa-cc bb-cc] + p = plot(collect(1:10),fill(1,10), ribbon=conf) + end # testset + end # testset From d0be1e7d1d7828abcc6a7b9f2fdd44f0d175d4c6 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 14:45:56 +0100 Subject: [PATCH 04/13] use UUIDs --- src/backends/pgfplotsx.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index dd410bb3..48ea317a 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -1,4 +1,5 @@ using Contour: Contour +using UUIDs Base.@kwdef mutable struct PGFPlotsXPlot is_created::Bool = false was_shown::Bool = false @@ -610,8 +611,8 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ribbon_y = repeat(ribbon_y, outer = ribbon_n) end # upper ribbon - # TODO: use UUIDs - ribbon_name_plus = "plots_rib_p$series_index" + rib_uuid = uuid4() + ribbon_name_plus = "plots_rib_p$rib_uuid" ribbon_opt_plus = merge(segment_plot.options, PGFPlotsX.Options( "name path" => ribbon_name_plus, "color" => opt[:fillcolor], @@ -624,7 +625,7 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ) push!(axis, ribbon_plot_plus) # lower ribbon - ribbon_name_minus = "plots_rib_m$series_index" + ribbon_name_minus = "plots_rib_m$rib_uuid" ribbon_opt_minus = merge(segment_plot.options, PGFPlotsX.Options( "name path" => ribbon_name_minus, "color" => opt[:fillcolor], From 7b31e5f9b83e9f5e4a2fe0032fc355c2f5bce2f0 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 15:04:22 +0100 Subject: [PATCH 05/13] fix ribbon legend --- src/backends/pgfplotsx.jl | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 48ea317a..a1f5d506 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -240,17 +240,12 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) # add fillrange if series[:fillrange] !== nothing && !isfilledcontour(series) && series[:ribbon] === nothing pgfx_fillrange_series!( axis, series, series_func, i, _cycle(series[:fillrange], rng), rng) - # add to legend? if i == 1 && opt[:label] != "" && sp[:legend] != :none && should_add_to_legend(series) - io = IOBuffer() - PGFPlotsX.print_tex(io, pgfx_fillstyle(opt, i)) - style = strip(String(take!(io)),['[',']', ' ']) - push!( segment_opt, "legend image code/.code" => """{ - \\draw[$style] (0cm,-0.1cm) rectangle (0.6cm,0.1cm); - }""" ) + pgfx_filllegend!(series_opt, opt) end end # series + # coordinates = pgfx_series_coordinates!( sp, series, segment_opt, opt, rng ) segment_plot = series_func( merge(series_opt, segment_opt), @@ -264,7 +259,11 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) end # add to legend? if i == 1 && opt[:label] != "" && sp[:legend] != :none && should_add_to_legend(series) - legend = PGFPlotsX.LegendEntry(PGFPlotsX.Options(), opt[:label], true) + leg_opt = PGFPlotsX.Options() + if ribbon !== nothing + pgfx_filllegend!(axis.contents[end-3].options, opt) + end + legend = PGFPlotsX.LegendEntry(leg_opt, opt[:label], false) push!( axis, legend ) end # add series annotations @@ -499,6 +498,15 @@ function pgfx_arrow( arr::Arrow ) return "every arrow/.append style={$(components)}" end +function pgfx_filllegend!( series_opt, opt ) + io = IOBuffer() + PGFPlotsX.print_tex(io, pgfx_fillstyle(opt)) + style = strip(String(take!(io)),['[',']', ' ']) + push!( series_opt, "legend image code/.code" => """{ + \\draw[$style] (0cm,-0.1cm) rectangle (0.6cm,0.1cm); + }""" ) +end + function pgfx_colormap(grad::ColorGradient) join(map(grad.colors) do c @sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c), blue(c)) From 2a720a74910c6b4ce39120739bf6a6411a9bc5ab Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 16:04:10 +0100 Subject: [PATCH 06/13] better ribbon tests --- test/test_pgfplotsx.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index 0629470a..dfbed5f0 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -139,5 +139,13 @@ end cc = rand(10) conf = [aa-cc bb-cc] p = plot(collect(1:10),fill(1,10), ribbon=conf) + Plots._update_plot_object(p) + axis = Plots.pgfx_axes(p.o)[1] + plots = filter(x->x isa PGFPlotsX.Plot, axis.contents) + @test length(plots) == 4 + @test !haskey(plots[1].options.dict, "fill") + @test !haskey(plots[2].options.dict, "fill") + @test !haskey(plots[3].options.dict, "fill") + @test haskey(plots[4].options.dict, "fill") end # testset end # testset From 9534bae4efeb533cff3c94de559b5c1071d9803d Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 18:22:02 +0100 Subject: [PATCH 07/13] support asymmetric ribbons --- src/backends/pgfplotsx.jl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index a1f5d506..c714d493 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -613,10 +613,17 @@ end function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_index ) ribbon_y = series[:ribbon] + @show ribbon_y opt = series.plotattributes if ribbon_y isa AVec ribbon_n = length(opt[:y]) ÷ length(ribbon_y) - ribbon_y = repeat(ribbon_y, outer = ribbon_n) + ribbon_yp = ribbon_ym = repeat(ribbon_y, outer = ribbon_n) + elseif ribbon_y isa Tuple + ribbon_ym, ribbon_yp = ribbon_y + ribbon_nm = length(opt[:y]) ÷ length(ribbon_ym) + ribbon_ym = repeat(ribbon_ym, outer = ribbon_nm) + ribbon_np = length(opt[:y]) ÷ length(ribbon_yp) + ribbon_yp = repeat(ribbon_yp, outer = ribbon_np) end # upper ribbon rib_uuid = uuid4() @@ -626,7 +633,7 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde "color" => opt[:fillcolor], "draw opacity" => opt[:fillalpha] )) - coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .+ ribbon_y) + coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .+ ribbon_yp) ribbon_plot_plus = series_func( ribbon_opt_plus, coordinates_plus @@ -639,7 +646,7 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde "color" => opt[:fillcolor], "draw opacity" => opt[:fillalpha] )) - coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .- ribbon_y) + coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .- ribbon_ym) ribbon_plot_plus = series_func( ribbon_opt_minus, coordinates_plus From d2c0840c43ec4d8bd9bd13b6bae7e1fb1c0fffb4 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 6 Dec 2019 19:37:35 +0100 Subject: [PATCH 08/13] fix dimensions --- src/backends/pgfplotsx.jl | 11 ++++++----- test/test_pgfplotsx.jl | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index c714d493..92e515e3 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -88,22 +88,22 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) "horizontal sep" => string(maximum(sp -> sp.minpad[1], plt.subplots)), "vertical sep" => string(maximum(sp -> sp.minpad[2], plt.subplots)), ), - "height" => pl_height > 0 ? string(pl_height)*"px" : "{}", - "width" => pl_width > 0 ? string(pl_width)*"px" : "{}", + "height" => pl_height > 0 ? string(pl_height * px) : "{}", + "width" => pl_width > 0 ? string(pl_width * px) : "{}", ) ) ) end for sp in plt.subplots bb = bbox(sp) + sp_width = width(bb) + sp_height = height(bb) cstr = plot_color(sp[:background_color_legend]) a = alpha(cstr) fg_alpha = alpha(plot_color(sp[:foreground_color_legend])) title_cstr = plot_color(sp[:titlefontcolor]) title_a = alpha(title_cstr) axis_opt = PGFPlotsX.Options( - "height" => string(height(bb)), - "width" => string(width(bb)), "title" => sp[:title], "title style" => PGFPlotsX.Options( "font" => pgfx_font(sp[:titlefontsize], pgfx_thickness_scaling(sp)), @@ -123,6 +123,8 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) ), "axis on top" => nothing, ) + sp_width > 0*mm ? push!(axis_opt, "width" => string(sp_width)) : nothing + sp_height > 0*mm ? push!(axis_opt, "height" => string(sp_height)) : nothing # legend position if sp[:legend] isa Tuple x, y = sp[:legend] @@ -613,7 +615,6 @@ end function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_index ) ribbon_y = series[:ribbon] - @show ribbon_y opt = series.plotattributes if ribbon_y isa AVec ribbon_n = length(opt[:y]) ÷ length(ribbon_y) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index dfbed5f0..90167f90 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -124,28 +124,39 @@ end u = ones(length(x)) v = cos.(x) - plot( x, y, quiver = (u, v), arrow = true ) + arrow_plot = plot( x, y, quiver = (u, v), arrow = true ) # TODO: could adjust limits to fit arrows if too long, but how? + mktempdir() do path + @test_nowarn savefig(arrow_plot, path*"arrow.pdf") + end end # testset @testset "Annotations" begin y = rand(10) plot(y, annotations=(3, y[3], Plots.text("this is \\#3", :left)), leg=false) annotate!([(5, y[5], Plots.text("this is \\#5", 16, :red, :center)), (10, y[10], Plots.text("this is \\#10", :right, 20, "courier"))]) - scatter!(range(2, stop=8, length=6), rand(6), marker=(50, 0.2, :orange), series_annotations=["series", "annotations", "map", "to", "series", Plots.text("data", :green)]) + annotation_plot = scatter!(range(2, stop=8, length=6), rand(6), marker=(50, 0.2, :orange), series_annotations=["series", "annotations", "map", "to", "series", Plots.text("data", :green)]) + mktempdir() do path + @test_nowarn savefig(annotation_plot, path*"annotation.pdf") + end end # testset @testset "Ribbon" begin aa = rand(10) bb = rand(10) cc = rand(10) conf = [aa-cc bb-cc] - p = plot(collect(1:10),fill(1,10), ribbon=conf) - Plots._update_plot_object(p) - axis = Plots.pgfx_axes(p.o)[1] + ribbon_plot = plot(collect(1:10),fill(1,10), ribbon=(conf[:,1],conf[:,2])) + Plots._update_plot_object(ribbon_plot) + axis = Plots.pgfx_axes(ribbon_plot.o)[1] plots = filter(x->x isa PGFPlotsX.Plot, axis.contents) @test length(plots) == 4 @test !haskey(plots[1].options.dict, "fill") @test !haskey(plots[2].options.dict, "fill") @test !haskey(plots[3].options.dict, "fill") @test haskey(plots[4].options.dict, "fill") + @test ribbon_plot.o !== nothing + @test ribbon_plot.o.the_plot !== nothing + mktempdir() do path + @test_nowarn savefig(ribbon_plot, path*"ribbon.svg") + end end # testset end # testset From 74ec895aca2a87039e756922c48ab1181debea3f Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sat, 7 Dec 2019 15:18:47 +0100 Subject: [PATCH 09/13] fix unintended filling of simple lines --- src/backends/pgfplotsx.jl | 3 +-- test/test_pgfplotsx.jl | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 92e515e3..6578ff0f 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -235,8 +235,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) segment_opt = merge( segment_opt, pgfx_marker(opt, i) ) end if st == :shape || - isfilledcontour(series) || - series[:ribbon] === nothing + isfilledcontour(series) segment_opt = merge( segment_opt, pgfx_fillstyle(opt, i) ) end # add fillrange diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index 90167f90..a9cebf44 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -16,6 +16,9 @@ end Plots._update_plot_object(pgfx_plot) @test pgfx_plot.o.the_plot isa PGFPlotsX.TikzDocument @test pgfx_plot.series_list[1].plotattributes[:quiver] === nothing + axis = Plots.pgfx_axes(pgfx_plot.o)[1] + @test count( x-> x isa PGFPlotsX.Plot, axis.contents ) == 1 + @test !haskey(axis.contents[1].options.dict, "fill") @testset "3D docs example" begin n = 100 From 203e351cefb6b9956308cb5265fe76e36ab7c7c5 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Mon, 9 Dec 2019 11:17:37 +0100 Subject: [PATCH 10/13] fix scalar ribbon --- src/backends/pgfplotsx.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 6578ff0f..7ff357f1 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -624,6 +624,8 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ribbon_ym = repeat(ribbon_ym, outer = ribbon_nm) ribbon_np = length(opt[:y]) ÷ length(ribbon_yp) ribbon_yp = repeat(ribbon_yp, outer = ribbon_np) + else + ribbon_yp = ribbon_ym = ribbon_y end # upper ribbon rib_uuid = uuid4() From 0e694a976752b937b8aaa2645b8f7a53e15199b2 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Mon, 9 Dec 2019 11:21:33 +0100 Subject: [PATCH 11/13] forget extra ribbon plot legend entries --- src/backends/pgfplotsx.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 7ff357f1..367f181a 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -633,7 +633,8 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ribbon_opt_plus = merge(segment_plot.options, PGFPlotsX.Options( "name path" => ribbon_name_plus, "color" => opt[:fillcolor], - "draw opacity" => opt[:fillalpha] + "draw opacity" => opt[:fillalpha], + "forget plot" => nothing )) coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .+ ribbon_yp) ribbon_plot_plus = series_func( @@ -646,7 +647,8 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde ribbon_opt_minus = merge(segment_plot.options, PGFPlotsX.Options( "name path" => ribbon_name_minus, "color" => opt[:fillcolor], - "draw opacity" => opt[:fillalpha] + "draw opacity" => opt[:fillalpha], + "forget plot" => nothing )) coordinates_plus = PGFPlotsX.Coordinates(opt[:x], opt[:y] .- ribbon_ym) ribbon_plot_plus = series_func( @@ -656,7 +658,7 @@ function pgfx_add_ribbons!( axis, series, segment_plot, series_func, series_inde push!(axis, ribbon_plot_plus) # fill push!(axis, series_func( - pgfx_fillstyle(opt, series_index), + merge(pgfx_fillstyle(opt, series_index), PGFPlotsX.Options("forget plot" => nothing)), "fill between [of=$(ribbon_name_plus) and $(ribbon_name_minus)]" )) return axis From 3dec7fe3944bb0027a04d7e6c9daec2846d1e849 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Wed, 11 Dec 2019 13:09:48 +0100 Subject: [PATCH 12/13] comment save tests --- test/test_pgfplotsx.jl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index a9cebf44..894e393a 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -129,18 +129,19 @@ end v = cos.(x) arrow_plot = plot( x, y, quiver = (u, v), arrow = true ) # TODO: could adjust limits to fit arrows if too long, but how? - mktempdir() do path - @test_nowarn savefig(arrow_plot, path*"arrow.pdf") - end + # TODO: get latex available on CI + # mktempdir() do path + # @test_nowarn savefig(arrow_plot, path*"arrow.pdf") + # end end # testset @testset "Annotations" begin y = rand(10) plot(y, annotations=(3, y[3], Plots.text("this is \\#3", :left)), leg=false) annotate!([(5, y[5], Plots.text("this is \\#5", 16, :red, :center)), (10, y[10], Plots.text("this is \\#10", :right, 20, "courier"))]) annotation_plot = scatter!(range(2, stop=8, length=6), rand(6), marker=(50, 0.2, :orange), series_annotations=["series", "annotations", "map", "to", "series", Plots.text("data", :green)]) - mktempdir() do path - @test_nowarn savefig(annotation_plot, path*"annotation.pdf") - end + # mktempdir() do path + # @test_nowarn savefig(annotation_plot, path*"annotation.pdf") + # end end # testset @testset "Ribbon" begin aa = rand(10) @@ -158,8 +159,8 @@ end @test haskey(plots[4].options.dict, "fill") @test ribbon_plot.o !== nothing @test ribbon_plot.o.the_plot !== nothing - mktempdir() do path - @test_nowarn savefig(ribbon_plot, path*"ribbon.svg") - end - end # testset + # mktempdir() do path + # @test_nowarn savefig(ribbon_plot, path*"ribbon.svg") + # end + # end # testset end # testset From 28d5e0bb7d0967e1fd825f8895fec8012aed3817 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Wed, 11 Dec 2019 13:23:50 +0100 Subject: [PATCH 13/13] commented too much --- test/test_pgfplotsx.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index 894e393a..91456fe3 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -162,5 +162,5 @@ end # mktempdir() do path # @test_nowarn savefig(ribbon_plot, path*"ribbon.svg") # end - # end # testset + end # testset end # testset