From 373d868a178e2bbb1c0680d2bb14756903eb498e Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Wed, 28 Oct 2015 01:12:20 -0400 Subject: [PATCH] gadfly color fixes; pyplot grid support --- src/backends/gadfly.jl | 4 ++-- src/backends/pyplot.jl | 7 +++++++ src/backends/supported.jl | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backends/gadfly.jl b/src/backends/gadfly.jl index 923d8f93..4d581471 100644 --- a/src/backends/gadfly.jl +++ b/src/backends/gadfly.jl @@ -127,7 +127,7 @@ function getGadflyMarkerTheme(d::Dict, initargs::Dict) Gadfly.Theme( default_color = c, default_point_size = d[:markersize] * Gadfly.px, - discrete_highlight_color = c -> fg, + discrete_highlight_color = c -> RGB(fg), highlight_width = d[:linewidth] * Gadfly.px, ) end @@ -145,7 +145,7 @@ function addGadflyMarker!(plt::Plot, d::Dict, initargs::Dict, geoms...) if !isa(d[:markercolor], ColorGradient) d[:markercolor] = colorscheme(:bluesreds) end - push!(getGadflyContext(plt).scales, Gadfly.Scale.ContinuousColorScale(p -> RGBA(getColorZ(d[:markercolor], p)))) + push!(getGadflyContext(plt).scales, Gadfly.Scale.ContinuousColorScale(p -> RGB(getColorZ(d[:markercolor], p)))) end Gadfly.layer(gfargs...; x = d[:x], y = d[:y], kwargs...) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 39643b7a..c7c31b89 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -423,6 +423,13 @@ function updatePlotItems(plt::Plot{PyPlotPackage}, d::Dict) lab[:set_fontsize](sz) end end + + # grid + if get(d, :grid, false) + ax[:xaxis][:grid](true) + ax[:yaxis][:grid](true) + ax[:set_axisbelow](true) + end end end diff --git a/src/backends/supported.jl b/src/backends/supported.jl index ee750052..901d1913 100644 --- a/src/backends/supported.jl +++ b/src/backends/supported.jl @@ -123,7 +123,7 @@ supportedArgs(::PyPlotPackage) = [ :tickfont, :guidefont, :legendfont, - # :grid, + :grid, :surface, :nlevels, ]