adjust color bar limits

This commit is contained in:
Simon Christ 2019-11-21 11:31:33 +01:00
parent 2cfd1838ca
commit 242d8b290d
2 changed files with 15 additions and 7 deletions

View File

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

View File

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