diff --git a/src/Gadfly.jl b/src/Gadfly.jl index b517bc2af..f5f083ec0 100755 --- a/src/Gadfly.jl +++ b/src/Gadfly.jl @@ -809,6 +809,18 @@ function render_prepared(plot::Plot, # IV. Geometries themes = Theme[layer.theme === nothing ? plot.theme : layer.theme for layer in plot.layers] + + for (layer, stats, aes, theme) in zip(plot.layers, layer_stats, layer_aess, themes) + + if length(stats)> 1 + @warn "stats" stats + end + + for stat in stats + apply_theme_transformations!(layer.geom, stat, aes, theme) + end + end + zips = trim_zip(plot.layers, layer_aess, layer_subplot_aess, layer_subplot_datas, @@ -1102,6 +1114,17 @@ include("geometry.jl") include("guide.jl") include("statistics.jl") +function apply_theme_transformations!(geom::GeometryElement, stat::StatisticElement, aes::Aesthetics, theme::Theme) +# @info "apply_theme_transformations!" geom stat aes theme +end + +function apply_theme_transformations!(geom::Geom.RectangularGeometry, stat::Stat.RectbinStatistic, aes::Aesthetics, theme::Theme) + + @info "apply_theme_transformations! specific to geom::Geom.RectangularGeometry, stat::Stat.RectbinStatistic combination." + + aes.xmax = aes.xmax .* cx .- theme.bar_spacing + aes.ymax = aes.ymax .* cy .- theme.bar_spacing +end # All aesthetics must have a scale. If none is given, we use a default. # The default depends on whether the input is discrete or continuous (i.e., diff --git a/src/geom/rectbin.jl b/src/geom/rectbin.jl index 64e84872f..ccf2f50d1 100644 --- a/src/geom/rectbin.jl +++ b/src/geom/rectbin.jl @@ -1,8 +1,8 @@ -function RectangularBinGeometry( - default_statistic::Gadfly.StatisticElement=Gadfly.Stat.rectbin(); - tag=empty_tag) - RectangularGeometry(default_statistic, tag) -end +# function RectangularBinGeometry( +# default_statistic::Gadfly.StatisticElement=Gadfly.Stat.rectbin(); +# tag=empty_tag) +# RectangularGeometry(default_statistic, tag) +# end """ Geom.rectbin @@ -10,7 +10,10 @@ end Draw equal sizes rectangles centered at `x` and `y` positions. Optionally specify their `color`. """ -const rectbin = RectangularBinGeometry +# const rectbin = RectangularBinGeometry +function rectbin() + RectangularGeometry(Gadfly.Stat.rectbin()) +end """ Geom.histogram2d[(; xbincount=nothing, xminbincount=3, xmaxbincount=150,