From 1819e3dd9966822180e8dea7a677d0222017c6c4 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 19 Nov 2019 11:58:57 +0100 Subject: [PATCH] fix colorbar --- src/backends/pgfplotsx.jl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index c3e13709..82a0bded 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -492,14 +492,16 @@ function _update_plot_object(plt::Plot{PGFPlotsXBackend}) for col in (:markercolor, :fillcolor, :linecolor) if typeof(series.plotattributes[col]) == ColorGradient # TODO: fix this - # pushed_colormap || push!(PGFPlotsX.CUSTOM_PREAMBLE, """\\pgfplotsset{ - # colormap={plots}{$(pgfx_colormap(series.plotattributes[col]))}, - # }""") - pushed_colormap = true - push!(axis_opt, - # "colormap" => nothing, - # "colormap name" => "plots", - ) + if !pushed_colormap + push!(PGFPlotsX.CUSTOM_PREAMBLE, """\\pgfplotsset{ + colormap={plots}{$(pgfx_colormap(series.plotattributes[col]))}, + }""") + pushed_colormap = true + push!(axis_opt, + "colorbar" => nothing, + "colormap name" => "plots", + ) + end # TODO: is this needed? # if sp[:colorbar] == :none