diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index ac088762..53ffbfe7 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -88,13 +88,9 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) end end @label colorbar_end - # detect fillranges - # if any(series->series[:fillrange] != nothing, series_list(sp)) - # PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usepgfplotslibrary{fillbetween},\n") - # end push!(axis_opt, "colorbar style" => PGFPlotsX.Options( - "title" => sp[:colorbar_title] + "title" => sp[:colorbar_title], ) ) axisf = if sp[:projection] == :polar @@ -110,6 +106,20 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) ) for series in series_list(sp) opt = series.plotattributes + if opt[:marker_z] !== nothing + cbar_style = axis_opt["colorbar style"] + if !haskey( cbar_style.dict, "point meta max" ) + append!( axis_opt["colorbar style"], + ( + "point meta max" => maximum(opt[:marker_z]), + "point meta min" => minimum(opt[:marker_z]) + ) + ) + else + cbar_style["point meta max"] = maximum(opt[:marker_z]) + cbar_style["point meta min"] = minimum(opt[:marker_z]) + end + end st = series[:seriestype] # function args args = if st == :contour diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index 5ffd62c8..21074e93 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -42,8 +42,6 @@ end @test marker.options["mark"] == "*" @test marker.options["mark options"]["color"] == RGBA{Float64}( colorant"green", 0.8) @test marker.options["mark options"]["line width"] == 1 - - # TODO: marker stroke color is incorrect end # testset @testset "Plot in pieces" begin plot(rand(100) / 3, reg=true, fill=(0, :green))