gadfly color fixes; pyplot grid support

This commit is contained in:
Thomas Breloff 2015-10-28 01:12:20 -04:00
parent 834ba9bc61
commit 373d868a17
3 changed files with 10 additions and 3 deletions

View File

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

View File

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

View File

@ -123,7 +123,7 @@ supportedArgs(::PyPlotPackage) = [
:tickfont,
:guidefont,
:legendfont,
# :grid,
:grid,
:surface,
:nlevels,
]