Open kstreet13 opened 3 years ago
gridGraphics::grid.echo()
to convert a {base}
graphics function into a {grid}
"grob" objectOnce you can generate {grid}
"grob" object versions of the mazes should either be possible to:
create a custom {gridpattern}
/ {ggpattern}
pattern which could be plotted to {ggplot2}
via the various {ggpattern}
geoms:
{mazealls}
: https://github.com/trevorld/gridpattern/issues/56gridpattern::alphaMaskGrob()
to "clip" to arbitrary boundaries...Alternatively write a custom {ggplot2}
geom extension: https://ggplot2.tidyverse.org/articles/extending-ggplot2.html
Straight up add the grid grob to {ggplot2}
image via {gggrid}
: https://github.com/pmur002/gggrid
as.data.frame.maze()
method that would generate the relevant columns for plotting with points or line segments. This may be enough on its own with some examples but it may be possible to go further and write an autolayer.maze()
and/or autoplot.maze()
method as well.
It would be great if there was a way to plot mazes with ggplot2, but unfortunately I am not the right person for that job. If anybody reading this has the know-how and wants to become an author on this package, please let me know!