diff --git a/src/backends/gaston.jl b/src/backends/gaston.jl index cd0ccc4a..5a87351e 100644 --- a/src/backends/gaston.jl +++ b/src/backends/gaston.jl @@ -229,7 +229,7 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series) if gsp.dims == 2 && z === nothing for (n, seg) in enumerate(series_segments(series, st; check = true)) i, rng = seg.attr_index, seg.range - fr =_cycle(series[:fillrange], 1:length(x[rng])) + fr = _cycle(series[:fillrange], 1:length(x[rng])) for sc in gaston_seriesconf!(sp, series, i, n == 1) push!(curves, Gaston.Curve(x[rng], y[rng], nothing, fr, sc)) end @@ -303,12 +303,15 @@ function gaston_seriesconf!( lc, dt, lw = gaston_lc_ls_lw(series, clims, i) pt, ps, mc = gaston_mk_ms_mc(series, clims, i) push!(curveconf, "w points pt $pt ps $ps lc $mc") - elseif st ∈ (:path, :straightline, :path3d) + elseif st ∈ (:path, :straightline, :path3d) fr = series[:fillrange] fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i)) lc, dt, lw = gaston_lc_ls_lw(series, clims, i) if fr !== nothing # filled curves, but not filled curves with markers - push!(curveconf, "w filledcurves fc $fc fs solid border lc $lc lw $lw dt $dt,'' w lines lc $lc lw $lw dt $dt") + push!( + curveconf, + "w filledcurves fc $fc fs solid border lc $lc lw $lw dt $dt,'' w lines lc $lc lw $lw dt $dt", + ) elseif series[:markershape] == :none # simplepath push!(curveconf, "w lines lc $lc dt $dt lw $lw") else diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 42dcffc3..e9de8630 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -139,18 +139,7 @@ gr_set_arrowstyle(s::Symbol) = GR.setarrowstyle( gr_set_fillstyle(::Nothing) = GR.setfillintstyle(GR.INTSTYLE_SOLID) function gr_set_fillstyle(s::Symbol) GR.setfillintstyle(GR.INTSTYLE_HATCH) - GR.setfillstyle(get( - ( - (/) = 9, - (\) = 10, - (|) = 7, - (-) = 8, - (+) = 11, - (x) = 6, - ), - s, - 9), - ) + GR.setfillstyle(get(((/) = 9, (\) = 10, (|) = 7, (-) = 8, (+) = 11, (x) = 6), s, 9)) end # -------------------------------------------------------------------------------------- diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 6c6d9fa6..0696ff57 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -1238,7 +1238,11 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter) opt, string(letter, "label style") => PGFPlotsX.Options( labelpos => nothing, - "at" => string("{(ticklabel cs:", get((left = 0, right = 1), axis[:guidefonthalign], 0.5),")}"), + "at" => string( + "{(ticklabel cs:", + get((left = 0, right = 1), axis[:guidefonthalign], 0.5), + ")}", + ), "anchor" => "near ticklabel", "font" => pgfx_font(axis[:guidefontsize], pgfx_thickness_scaling(sp)), "color" => cstr, @@ -1300,10 +1304,7 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter) string("{\$", join(tick_labels, "\$,\$"), "\$}"), ) elseif tick_labels isa Vector{LaTeXString} - push!( - opt, - string(letter, "ticklabels") => join(tick_labels) - ) + push!(opt, string(letter, "ticklabels") => join(tick_labels)) end elseif axis[:showaxis] tick_labels = diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 0df6a3a0..062a5231 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -795,7 +795,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) edgecolor = py_color(fc, has_fs ? fa : la), facecolor = py_color(fc, has_fs ? 0 : fa), hatch = py_fillstyle(fs), - linewidths = 0 + linewidths = 0, ) push!(handles, handle) end @@ -1499,7 +1499,10 @@ function py_add_legend(plt::Plot, sp::Subplot, ax) line_handle = pypatches."Patch"( edgecolor = py_color(single_color(lc), la), facecolor = py_color(single_color(fc), has_fs ? 0 : fa), - linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)), + linewidth = py_thickness_scale( + plt, + clamp(get_linewidth(series), 0, 5), + ), linestyle = py_linestyle(series[:seriestype], ls), capstyle = "butt", ) diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index 4149cce2..86496cb2 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -68,7 +68,14 @@ function rebuildUnicodePlot!(plt::Plot, width, height) end # add a single series -function addUnicodeSeries!(sp::Subplot{UnicodePlotsBackend}, o, series, addlegend::Bool, xlim, ylim) +function addUnicodeSeries!( + sp::Subplot{UnicodePlotsBackend}, + o, + series, + addlegend::Bool, + xlim, + ylim, +) attrs = series.plotattributes st = attrs[:seriestype] @@ -76,10 +83,13 @@ function addUnicodeSeries!(sp::Subplot{UnicodePlotsBackend}, o, series, addlegen if st == :histogram2d return UnicodePlots.densityplot!(o, attrs[:x], attrs[:y]) elseif st == :heatmap - rng = range(0, 1, length=length(UnicodePlots.COLOR_MAP_DATA[:viridis])) + rng = range(0, 1, length = length(UnicodePlots.COLOR_MAP_DATA[:viridis])) cmap = [(red(c), green(c), blue(c)) for c in get(get_colorgradient(series), rng)] return UnicodePlots.heatmap( - series[:z].surf; title = sp[:title], zlabel = sp[:colorbar_title], colormap = cmap + series[:z].surf; + title = sp[:title], + zlabel = sp[:colorbar_title], + colormap = cmap, ) elseif st == :spy return UnicodePlots.spy(series[:z].surf; title = sp[:title]) @@ -90,8 +100,8 @@ function addUnicodeSeries!(sp::Subplot{UnicodePlotsBackend}, o, series, addlegen func = UnicodePlots.lineplot! elseif st == :scatter || attrs[:markershape] != :none func = UnicodePlots.scatterplot! - # elseif st == :bar - # func = UnicodePlots.barplot! + # elseif st == :bar + # func = UnicodePlots.barplot! elseif st == :shape func = UnicodePlots.lineplot! else @@ -149,12 +159,15 @@ function png(plt::Plot{UnicodePlotsBackend}, fn::AbstractString) return elseif Sys.islinux() run(`clear`) - gui(plt); println() + gui(plt) + println() run(`import -window $(ENV["WINDOWID"]) $fn`) return end - error("Can only savepng on MacOS or Linux with UnicodePlots (though even then I wouldn't do it)") + error( + "Can only savepng on MacOS or Linux with UnicodePlots (though even then I wouldn't do it)", + ) end # ------------------------------- diff --git a/test/runtests.jl b/test/runtests.jl index fa8d9099..d847b5fc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,7 +15,9 @@ using RecipesBase using JSON @testset "Infrastructure" begin - @test_nowarn JSON.Parser.parse(String(read(joinpath(dirname(pathof(Plots)), "..", ".zenodo.json")))) + @test_nowarn JSON.Parser.parse( + String(read(joinpath(dirname(pathof(Plots)), "..", ".zenodo.json"))), + ) end @testset "Plotly standalone" begin