I want to know how to get a ggplot style background in Gadfly, including the grey color and the grids, etc.
# Can use Theme() or style() ggplot_theme = Theme(panel_fill="gray90", grid_color="white") # ggplot_theme = style(panel_fill=colorant"gray90", grid_color=colorant"white") p = plot(x=1:5, y=rand(5), Geom.line, ggplot_theme)
If you want to use a
Theme that you’ve created on a number of plots, then do e.g.
For more info, see http://gadflyjl.org/stable/man/themes.html
Thanks. How can I make the grid edge solid line instead of dot line?
grid_strokedash is missing from the docs, but type
dump(Theme()) to see the full list.
And a new example:
using Colors, DataFrames, Gadfly, RDatasets palette(n::Int) = LCHuv.(65, 100, 15:(360/n):374) colscale = Scale.color_discrete(palette) ggplot_theme = Theme(panel_fill="gray90", grid_color="white", grid_strokedash=[5mm, 0mm], discrete_color_scale=colscale) p = plot(dataset("datasets","iris"), x=:PetalWidth, y=:SepalLength, color=:Species, Geom.point, ggplot_theme)
That is exactly what I want!