Open grantmcdermott opened 1 week ago
Regarding the themes, I agree with your suggestions. But I cannot contribute much at the moment because I'm not familiar with the details of how basetheme
works (and where it doesn't work).
Regarding the dynamic resizing, I agree this would be useful in many situations, especially when there is no main title and we just waste a lot of space. However, I would make that functionality optional in order to keep the compatibility with the base plot()
function (which is also one of the design goals, isn't it?).
Similar to
ggplot2
's built-in themes, it would be cool if we could support a minimal set oftinyplot
themes.Some quick thoughts:
In the vignette, we point users to the (excellent) basetheme package. But I've noticed that
basetheme
doesn't always play well with some oftinyplot
's unique features, particularly w.r.t. faceting and legend text. OTOH I really like the general design and implementation using hooks. Perhaps we could borrow from these ideas.If we were being ambitious, we could look at dynamically resizing plot margins and margin gaps (
mgp
) to reduce/optimize whitespace for certain themes. Specifically, this behaviour would depend on criteria like whether main and axis titles are provided, whetherlas = 1
, etc. The UX trade-off here would be that users potentially couldn't add, say, titles afterwards. But I think the general aim oftinyplot
is to take care of plot arrangement in a single function call anyway, so that doesn't seem so bad a tradeoff to me. (Related: #112)Ideally, users could set themes globally (via
tpar()
or a dedicatedtinytheme()
function?), or directly for an individual plot via atinyplot(..., theme = <theme_string>)
argument.One minor thing I'd like to support is positioning and font styles of titles. To highlight one thing: personally, I've never liked the default position and styling of
sub
, since it feels like a clunky part of the x-axis title, rather than an actual subtitle (which I'd expect below the main title.) Come to think of it, maybe we should introduce a separatecaption
argument...