direct colormap access
This commit is contained in:
parent
f2af121661
commit
091ca327ba
@ -158,6 +158,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
|||||||
push!(axis_opt,
|
push!(axis_opt,
|
||||||
"colorbar" => nothing,
|
"colorbar" => nothing,
|
||||||
"colormap name" => "plots$(sp.attr[:subplot_index])",
|
"colormap name" => "plots$(sp.attr[:subplot_index])",
|
||||||
|
"colormap access" => "direct",
|
||||||
)
|
)
|
||||||
# goto is needed to break out of col and series for
|
# goto is needed to break out of col and series for
|
||||||
@goto colorbar_end
|
@goto colorbar_end
|
||||||
@ -167,10 +168,10 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
|||||||
@label colorbar_end
|
@label colorbar_end
|
||||||
|
|
||||||
push!(axis_opt, "colorbar style" => PGFPlotsX.Options(
|
push!(axis_opt, "colorbar style" => PGFPlotsX.Options(
|
||||||
"title" => sp[:colorbar_title],
|
"title" => sp[:colorbar_title],
|
||||||
"point meta max" => get_clims(sp)[2],
|
"point meta max" => get_clims(sp)[2],
|
||||||
"point meta min" => get_clims(sp)[1]
|
"point meta min" => get_clims(sp)[1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if is3d(sp)
|
if is3d(sp)
|
||||||
azim, elev = sp[:camera]
|
azim, elev = sp[:camera]
|
||||||
@ -192,7 +193,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
|||||||
series_opt = PGFPlotsX.Options(
|
series_opt = PGFPlotsX.Options(
|
||||||
"color" => single_color(opt[:linecolor]),
|
"color" => single_color(opt[:linecolor]),
|
||||||
)
|
)
|
||||||
if is3d(series) || st == :heatmap #|| isfilledcontour(series)
|
if is3d(series) || st == :heatmap
|
||||||
series_func = PGFPlotsX.Plot3
|
series_func = PGFPlotsX.Plot3
|
||||||
else
|
else
|
||||||
series_func = PGFPlotsX.Plot
|
series_func = PGFPlotsX.Plot
|
||||||
@ -336,7 +337,7 @@ function pgfx_series_coordinates!(st_val::Val{:heatmap}, segment_opt, opt, args)
|
|||||||
push!(segment_opt,
|
push!(segment_opt,
|
||||||
"surf" => nothing,
|
"surf" => nothing,
|
||||||
"mesh/rows" => length(opt[:x]),
|
"mesh/rows" => length(opt[:x]),
|
||||||
"mesh/cols" => length(opt[:y])
|
"mesh/cols" => length(opt[:y]),
|
||||||
)
|
)
|
||||||
return PGFPlotsX.Table(args...)
|
return PGFPlotsX.Table(args...)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -80,7 +80,8 @@ end
|
|||||||
z = float((1:4) * reshape(1:10, 1, :))
|
z = float((1:4) * reshape(1:10, 1, :))
|
||||||
pgfx_plot = heatmap(xs, ys, z, aspect_ratio=1)
|
pgfx_plot = heatmap(xs, ys, z, aspect_ratio=1)
|
||||||
Plots._update_plot_object(pgfx_plot)
|
Plots._update_plot_object(pgfx_plot)
|
||||||
if @test_nowarn(haskey(Plots.pgfx_axes(pgfx_plot.o)[1].options.dict, "colorbar") == true)
|
if
|
||||||
|
@test_nowarn(haskey(Plots.pgfx_axes(pgfx_plot.o)[1].options.dict, "colorbar") == true)
|
||||||
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colorbar"] === nothing
|
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colorbar"] === nothing
|
||||||
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colormap name"] == "plots1"
|
@test Plots.pgfx_axes(pgfx_plot.o)[1]["colormap name"] == "plots1"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user