Skip to content
Prev 5066 / 63424 Next

Scatter plot calling R function from C

Hi
As Brian says, the first big obstacle is getting a device started, which can
only be done from R.  Once you have that, then all of the necessary graphics
is there in Rgraphics.h, but its at a very low level.  Rgraphics.h gives you
access to a basic graphics engine for drawing lines and rectangles and such,
plus some more complicated things like data symbols, but it does not have
anything really high level like a plot or even an axis.  You have to compose
these things yourself.

There are examples of how R uses these functions in R/src/main/plot.c, but
it would take a considerable effort to work out what is going on.

The functions Rgraphics.h exports are useful if you want to write your own
graphics system from the ground up, but they are not very useful if you want
to produce plots like the ones that R already produces.  If you want to do
the latter then you are much better to try the route suggested by Brian and
embed R in your C program so that you can call R's high-level graphics
functions.

Hope that helps

Paul






-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._