logoalt Hacker News

bittumenEntitytoday at 11:48 AM2 repliesview on HN

It is! And that's kinda the point.

Like others mention, this is inspired by ggplot2, a Grammar of Graphics library. The whole idea is graphics are composed by adding "layers", not like layers on a canvas, but like pouring paint into a pot, then the library understands the content and paints it to the canvas.

Layers might be pure data, geometry (lines, points, ...), annotations, styles, axis, etc.

When you get familiar with it, it's much more natural way of describing plots, better composition and easier exploration


Replies

bittumenEntitytoday at 11:51 AM

And a side note, R actually includes a pipe operator (as in Unix `|`), and said if they'd know about it at the time, they would have never used the `+` operator

bbminnertoday at 1:18 PM

How `plot(.. + ggsize(700, 300) + ..)` is superior to a keyword parameter `plot(.. , size = (700, 300), ..)`?

show 1 reply