Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
32 stars 36 forks source link

Output to raw R object #36

Open cameronbracken opened 13 years ago

cameronbracken commented 13 years ago

This was requested by a user a while back, It would likely require a some restructuring of the C code. Usage would be something like ggplot2:

p <- tikz(raw=TRUE)
plot(...)
dev.off()

Or

tikz(raw=TRUE,object='p')
plot(...)
dev.off()

then the user could

print(p)

to print to the screen or

print(p,file='foo.tex')

to print to a file.

The second method would probably be more feasible.

Sharpie commented 13 years ago

I have thought about this one recently---If we stored the plot as, say grid graphics objects, then we would be able to do all sorts of optimizations and neat tricks.

For example:

This would require a lot of careful thinking and planning though.

cameronbracken commented 13 years ago

I am thinking of taking a rough cut at this by simply adding something to printOutput that would direct the printed lines (as a character vector) to the object specified by the user as an argument. This could at least be a side feature for now like console output and could get revamped in the future to help with optimizations.

cameronbracken commented 13 years ago

First cut: 0a59d3

Sharpie commented 12 years ago

I'm going to bump this to a later as I have a few ideas for storing device output in order to allow for better optimization and formatting of output. Making the device output available as an R object would fit in nicely with this strategy.

Plus, there has been a lot of re-organization of the C code since version 0.6.2. I think it would be best to draw a line and cut a release so that the new changes get tested in the real world before adding even more features.