TidierOrg / TidierPlots.jl

Tidier data visualization in Julia, modeled after the ggplot2 R package.
MIT License
196 stars 7 forks source link

Specify figure size #105

Closed cnrrobertson closed 1 month ago

cnrrobertson commented 1 month ago

Describe how it works in R's ggplot2 In ggsave, height and width should be options to specify. I'm not sure if there is another way to enforce figure size in ggplot though.

Describe any changes you think should be made to R's version I think it would be an improvement to be able to specify figure size at least when printing. This can be done currently by passing a kwarg to Makie.plot like:

my_plot = ggplot(df, @aes(x=x,y=y)) + geom_line();
Makie.plot(Makie.SpecApi.GridLayout(Makie.SpecApi.Axis(my_plot)); figure=(;size=(1000, 1000)))

We could possibly allow figure or size as a kwarg to draw_ggplot. Or would it be better to somehow package these figure settings into the GGPlot object itself so they are carried around with it?

rdboyes commented 1 month ago

Thanks! Added in https://github.com/TidierOrg/TidierPlots.jl/commit/837ff9209d932dfc35661e18a4de5c196b2364e8